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

C#

 
GeneralSetup and Installation Project Pin
Praveen Nayak14-Jul-04 0:19
Praveen Nayak14-Jul-04 0:19 
GeneralRe: Setup and Installation Project Pin
Heath Stewart14-Jul-04 5:11
protectorHeath Stewart14-Jul-04 5:11 
GeneralRe: Setup and Installation Project Pin
Praveen Nayak14-Jul-04 5:23
Praveen Nayak14-Jul-04 5:23 
GeneralRe: Setup and Installation Project Pin
Heath Stewart14-Jul-04 5:42
protectorHeath Stewart14-Jul-04 5:42 
GeneralYou Can Also Post Your Openion. Pin
sreejith ss nair13-Jul-04 22:57
sreejith ss nair13-Jul-04 22:57 
GeneralRe: You Can Also Post Your Openion. Pin
Dave Kreskowiak14-Jul-04 8:28
mveDave Kreskowiak14-Jul-04 8:28 
GeneralA question about Image of PictureBox Pin
Member 94012513-Jul-04 21:47
Member 94012513-Jul-04 21:47 
GeneralRe: A question about Image of PictureBox Pin
Heath Stewart14-Jul-04 5:32
protectorHeath Stewart14-Jul-04 5:32 
GeneralCheckin dynamically added elements Pin
saud_a_k13-Jul-04 20:53
saud_a_k13-Jul-04 20:53 
GeneralRe: Checkin dynamically added elements Pin
Jay Shankar13-Jul-04 22:24
Jay Shankar13-Jul-04 22:24 
GeneralRe: Checkin dynamically added elements Pin
saud_a_k13-Jul-04 23:05
saud_a_k13-Jul-04 23:05 
GeneralRe: Checkin dynamically added elements Pin
mav.northwind13-Jul-04 23:51
mav.northwind13-Jul-04 23:51 
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 

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.