Click here to Skip to main content
15,924,507 members
Home / Discussions / C#
   

C#

 
GeneralRe: monitor Pin
ygxdha7-Jun-02 1:24
ygxdha7-Jun-02 1:24 
General#ifdef _DEBUG equivalent in C# Pin
paulb6-Jun-02 18:11
paulb6-Jun-02 18:11 
GeneralRe: #ifdef _DEBUG equivalent in C# Pin
James T. Johnson6-Jun-02 18:34
James T. Johnson6-Jun-02 18:34 
GeneralRemoting + Singletons Pin
Mauricio Ritter6-Jun-02 16:19
Mauricio Ritter6-Jun-02 16:19 
GeneralRe: Remoting + Singletons Pin
James T. Johnson6-Jun-02 18:59
James T. Johnson6-Jun-02 18:59 
GeneralRe: Remoting + Singletons Pin
Mauricio Ritter7-Jun-02 1:26
Mauricio Ritter7-Jun-02 1:26 
GeneralRe: Remoting + Singletons Pin
Mauricio Ritter7-Jun-02 1:57
Mauricio Ritter7-Jun-02 1:57 
GeneralRe: Remoting + Singletons Pin
James T. Johnson7-Jun-02 8:22
James T. Johnson7-Jun-02 8:22 
Upon further investigation it looks like you don't *need* to have a delegate after-all.

Something like this (psuedo-code)

// This delegate is specific to our method; all the heavy work 
// will be done inside of it.
private delegate void DoWorkDelegate(WorkArgs e);
 
// The whole purpose of WorkArgs is to make the delegate cleaner; if 
// you only have a few args by all means use that :)
public void DoWork(WorkArgs e)
{
  DoWorkDelegate dwd = new DoWorkDelegate(DoWorkReal);
 
  IAsyncResult ar = dwd.BeginInvoke(e /* The args to the delegate */
                    null, null);
 
  // Wait until work is done; this uses 0 CPU time
  ar.AsyncWaitHandle.WaitOne(); 
  
  if( ar.IsCompleted ) // should always be true
  { 
    wdw.EndInvoke(ar);
    
    // Work is done
  }
}
 
// This is where you do the real heavy work
private void DoWorkReal(WorkArgs e) // Signature must match the delegate
{
  // Do the work here
}
Uncompiled code, but so much for my psuedo-code Smile | :)

HTH,

James
GeneralSending mail via SMTP server Pin
6-Jun-02 7:47
suss6-Jun-02 7:47 
GeneralRe: Sending mail via SMTP server Pin
Sebastian Weber6-Jun-02 9:40
Sebastian Weber6-Jun-02 9:40 
GeneralRe: Sending mail via SMTP server Pin
James T. Johnson6-Jun-02 9:57
James T. Johnson6-Jun-02 9:57 
GeneralRe: Sending mail via SMTP server Pin
7-Jun-02 3:36
suss7-Jun-02 3:36 
GeneralRead file access permission and other info. Pin
serberwww5-Jun-02 20:48
serberwww5-Jun-02 20:48 
GeneralRe: Read file access permission and other info. Pin
Mazdak5-Jun-02 22:44
Mazdak5-Jun-02 22:44 
GeneralRe: Read file access permission and other info. Pin
serberwww5-Jun-02 23:18
serberwww5-Jun-02 23:18 
GeneralRe: Read file access permission and other info. Pin
Mazdak5-Jun-02 23:33
Mazdak5-Jun-02 23:33 
GeneralRe: Read file access permission and other info. Pin
James T. Johnson6-Jun-02 19:02
James T. Johnson6-Jun-02 19:02 
GeneralRe: Read file access permission and other info. Pin
serberwww6-Jun-02 20:28
serberwww6-Jun-02 20:28 
QuestionMSCOREE.DLL? Pin
5-Jun-02 15:03
suss5-Jun-02 15:03 
AnswerRe: MSCOREE.DLL? Pin
RichB5-Jun-02 15:24
RichB5-Jun-02 15:24 
AnswerRe: MSCOREE.DLL? Pin
Rama Krishna Vavilala5-Jun-02 15:34
Rama Krishna Vavilala5-Jun-02 15:34 
GeneralGDI+ Grab Handles Question Pin
RichB5-Jun-02 14:44
RichB5-Jun-02 14:44 
QuestionCan I extend the System.Drawing.Image class Pin
franck_alain5-Jun-02 13:32
franck_alain5-Jun-02 13:32 
AnswerRe: Can I extend the System.Drawing.Image class Pin
Nick Parker5-Jun-02 17:18
protectorNick Parker5-Jun-02 17:18 
GeneralTreeView node right-clicked is not the "selected" node... Pin
rhoward5-Jun-02 10:43
professionalrhoward5-Jun-02 10:43 

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.