Click here to Skip to main content
15,921,531 members
Home / Discussions / C#
   

C#

 
GeneralRe: Checkin dynamically added elements Pin
Jay Shankar14-Jul-04 14:33
Jay Shankar14-Jul-04 14:33 
GeneralRe: Checkin dynamically added elements Pin
mav.northwind14-Jul-04 20:05
mav.northwind14-Jul-04 20:05 
GeneralDetermining RightToLeft Property Pin
13-Jul-04 20:50
suss13-Jul-04 20:50 
QuestionWhat's the difference ? Pin
PShweta13-Jul-04 19:45
PShweta13-Jul-04 19:45 
AnswerRe: What's the difference ? Pin
Roman Rodov13-Jul-04 20:00
Roman Rodov13-Jul-04 20:00 
GeneralRe: What's the difference ? Pin
PShweta14-Jul-04 0:17
PShweta14-Jul-04 0:17 
QuestionReplicate CancelEventArgs behaviour? Pin
misterbear13-Jul-04 19:34
misterbear13-Jul-04 19:34 
AnswerRe: Replicate CancelEventArgs behaviour? Pin
mav.northwind14-Jul-04 0:04
mav.northwind14-Jul-04 0:04 
If there's just a single event handler attached, then it's fairly easy:

In your class you need:

public delegate MyCancelHandler(bool cancel);
 
public event MyCancelHandler AnEventThatCanBeCancelled;
 
// Later on when you want the event to fire
if (AnEventThatCanBeCancelled != null)
{
  bool cancel = false;
  AnEventThatCanBeCancelled(cancel);
  
  if (cancel)
  {
    MessageBox.Show("Event has been cancelled by a listener");
  }
  else
  {
    MessageBox.Show("Event has NOT been cancelled, go on with whatever you want");
  }
}

If there's more than one listener attached, then you'll only get the cancel info of the last listener notified.
In this case you'll have to go through all registered delegates (using MulticastDelegate.GetInvocationList()) and check all of them if anyone wants to cancel your event.

Regards,
mav
GeneralRe: Replicate CancelEventArgs behaviour? Pin
Heath Stewart14-Jul-04 4:52
protectorHeath Stewart14-Jul-04 4:52 
GeneralRe: Replicate CancelEventArgs behaviour? Pin
mav.northwind14-Jul-04 5:36
mav.northwind14-Jul-04 5:36 
QuestionHow to make Make and IDE??? Pin
ilmian13-Jul-04 19:25
ilmian13-Jul-04 19:25 
Generalworking with https Pin
niko.13-Jul-04 17:51
sussniko.13-Jul-04 17:51 
GeneralRe: working with https Pin
Heath Stewart14-Jul-04 4:37
protectorHeath Stewart14-Jul-04 4:37 
GeneralRe: working with https Pin
Anonymous14-Jul-04 6:31
Anonymous14-Jul-04 6:31 
QuestionHow to use UdpClient class? Pin
skywen13-Jul-04 17:00
skywen13-Jul-04 17:00 
AnswerRe: How to use UdpClient class? Pin
Heath Stewart14-Jul-04 4:24
protectorHeath Stewart14-Jul-04 4:24 
GeneralChild Control Painting problem(For the last time) Pin
Jon_Slaughter13-Jul-04 13:54
Jon_Slaughter13-Jul-04 13:54 
GeneralRe: Child Control Painting problem(For the last time) Pin
Heath Stewart14-Jul-04 4:12
protectorHeath Stewart14-Jul-04 4:12 
GeneralRe: Child Control Painting problem(For the last time) Pin
Jon_Slaughter14-Jul-04 5:28
Jon_Slaughter14-Jul-04 5:28 
GeneralRe: Child Control Painting problem(For the last time) Pin
Heath Stewart14-Jul-04 6:01
protectorHeath Stewart14-Jul-04 6:01 
GeneralBigger ImageList Pin
blankg13-Jul-04 11:50
blankg13-Jul-04 11:50 
GeneralRe: Bigger ImageList Pin
Heath Stewart14-Jul-04 4:01
protectorHeath Stewart14-Jul-04 4:01 
Generaldisable network card throw c# Pin
vipervip13-Jul-04 11:06
vipervip13-Jul-04 11:06 
Generalconfig file in console app to store connection string help Pin
mtbjr13-Jul-04 10:25
mtbjr13-Jul-04 10:25 
GeneralRe: config file in console app to store connection string help Pin
Heath Stewart14-Jul-04 3:56
protectorHeath Stewart14-Jul-04 3:56 

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.