Click here to Skip to main content
16,006,440 members
Home / Discussions / C#
   

C#

 
AnswerRe: CAN ANY BODY ANSWER TO QUESTION/!!!!!???? Pin
Colin Angus Mackay2-Mar-07 5:21
Colin Angus Mackay2-Mar-07 5:21 
AnswerRe: CAN ANY BODY ANSWER TO QUESTION/!!!!!???? Pin
Dave Kreskowiak2-Mar-07 6:16
mveDave Kreskowiak2-Mar-07 6:16 
QuestionHow can i save data in access database Pin
conemajstor2-Mar-07 4:18
conemajstor2-Mar-07 4:18 
AnswerRe: How can i save data in access database Pin
Chris Buckett2-Mar-07 5:19
Chris Buckett2-Mar-07 5:19 
QuestionAssembly initialization... Pin
Phil Boyd2-Mar-07 3:55
Phil Boyd2-Mar-07 3:55 
AnswerRe: Assembly initialization... Pin
Scott Dorman2-Mar-07 4:25
professionalScott Dorman2-Mar-07 4:25 
GeneralRe: Assembly initialization... Pin
Phil Boyd2-Mar-07 6:54
Phil Boyd2-Mar-07 6:54 
GeneralRe: Assembly initialization... Pin
Scott Dorman2-Mar-07 7:01
professionalScott Dorman2-Mar-07 7:01 
There aren't any equivalent events like Assembly.Load. It still sounds like the best approach would be to implement a singleton MQManager class. Since it is a singleton you can hide all of the initialization details behind an explicit Register method. Each "normal" method can check the state and initialize as needed.

Something like this (rough pseudo-code):
public class MQManager {
   private bool registered;
 
   public void Register() {
      if (!registered) {
         // register
         registered = true;
      }
   }
 
   public void AddMessage() {
      Register();
      MQ.Add();
   }
}

Since the Register function protects itself from registering more than once through the registered flag, it is safe to call multiple times. Also, since the AddMessage function makes a call to Register before doing anything else, it is safe to be called by the user without having first explicitly called Register.


-----------------------------
In just two days, tomorrow will be yesterday.

GeneralRe: Assembly initialization... Pin
Phil Boyd2-Mar-07 11:12
Phil Boyd2-Mar-07 11:12 
QuestionHow to stop a timer from within it's eventhandler? Pin
Hussam Fattahi2-Mar-07 3:52
Hussam Fattahi2-Mar-07 3:52 
AnswerRe: How to stop a timer from within it's eventhandler? Pin
Stefan Troschuetz2-Mar-07 4:28
Stefan Troschuetz2-Mar-07 4:28 
AnswerRe: How to stop a timer from within it's eventhandler? Pin
S. Senthil Kumar2-Mar-07 4:48
S. Senthil Kumar2-Mar-07 4:48 
GeneralRe: How to stop a timer from within it's eventhandler? Pin
Stefan Troschuetz2-Mar-07 5:13
Stefan Troschuetz2-Mar-07 5:13 
GeneralRe: How to stop a timer from within it's eventhandler? Pin
S. Senthil Kumar2-Mar-07 5:31
S. Senthil Kumar2-Mar-07 5:31 
GeneralRe: How to stop a timer from within it's eventhandler? Pin
Hussam Fattahi2-Mar-07 5:31
Hussam Fattahi2-Mar-07 5:31 
QuestionOut of Focus Event Pin
mrarunks2-Mar-07 3:35
mrarunks2-Mar-07 3:35 
AnswerRe: Out of Focus Event Pin
Colin Angus Mackay2-Mar-07 3:36
Colin Angus Mackay2-Mar-07 3:36 
AnswerRe: Out of Focus Event Pin
Stefan Troschuetz2-Mar-07 3:39
Stefan Troschuetz2-Mar-07 3:39 
Questionreturn value Pin
md_refay2-Mar-07 2:15
md_refay2-Mar-07 2:15 
AnswerRe: return value Pin
Not Active2-Mar-07 2:20
mentorNot Active2-Mar-07 2:20 
AnswerRe: return value Pin
Frank Kerrigan2-Mar-07 2:22
Frank Kerrigan2-Mar-07 2:22 
AnswerRe: return value Pin
Colin Angus Mackay2-Mar-07 2:25
Colin Angus Mackay2-Mar-07 2:25 
AnswerRe: return value Pin
Colin Angus Mackay2-Mar-07 6:34
Colin Angus Mackay2-Mar-07 6:34 
QuestionSending mail through gmail Pin
sharpiesharpie2-Mar-07 1:37
sharpiesharpie2-Mar-07 1:37 
AnswerRe: Sending mail through gmail Pin
Frank Kerrigan2-Mar-07 2:25
Frank Kerrigan2-Mar-07 2:25 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.