Click here to Skip to main content
16,004,991 members
Home / Discussions / C#
   

C#

 
GeneralRe: Recognising barcode? Pin
Vertyg06-Apr-06 9:52
Vertyg06-Apr-06 9:52 
Questionoverriding an @ to force control chars to be interpreted Pin
Dan Neely5-Apr-06 8:37
Dan Neely5-Apr-06 8:37 
AnswerRe: overriding an @ to force control chars to be interpreted Pin
Guffa5-Apr-06 9:21
Guffa5-Apr-06 9:21 
Questionxpath not working with an xmlns attribute Pin
Hari 20095-Apr-06 6:54
Hari 20095-Apr-06 6:54 
AnswerRe: xpath not working with an xmlns attribute Pin
Guffa5-Apr-06 8:02
Guffa5-Apr-06 8:02 
GeneralRe: xpath not working with an xmlns attribute Pin
Hari 20095-Apr-06 8:43
Hari 20095-Apr-06 8:43 
QuestionSoapHeaders??? Pin
bakerfishsticks5-Apr-06 6:05
bakerfishsticks5-Apr-06 6:05 
QuestionClearing event handlers Pin
vineas5-Apr-06 5:44
vineas5-Apr-06 5:44 
Is there some way anyone knows to clear out the handlers for an event? An object I've created needs to clear all handlers to it at a point in the code where it is unknown what is attached to it.

You can't just set the event to null, the compiler complains about that. I've also tried the following to no effect:

...
  if (MyEvent != null)
  {
    Delegate[] delegateList = MyEvent.GetInvocationList();
    foreach (MyEventHandler meh in delegateList)
    {
      MyEvent -= meh;
    }
  }
...


I thought it showed promise (the compiler didn't complain, and it did run fine) - unfortunately it simply didn't do anything.

I've also tried some variations to the above, using the normal way of decoupling from an event, but by trying some of the values of the delegate to get the method:

...
  if (MyEvent != null)
  {
    Delegate[] delegateList = MyEvent.GetInvocationList();
    foreach (MyEventHandler meh in delegateList)
    {
      MyEvent -= new MyEventHandler(meh.Method);
    }
  }
...


- but the Delegate.Method property (as well as it's properties) don't seem to contain the right value wanted (the compiler makes noise about the fact that a property is being passed in to the handler instead of a method).

I think I'm on the right track, but seem to be missing some key element to make it work. Anyone have any ideas?

-----
In the land of the blind, the one eyed man is king.
AnswerRe: Clearing event handlers Pin
Ed.Poore5-Apr-06 7:46
Ed.Poore5-Apr-06 7:46 
GeneralRe: Clearing event handlers Pin
vineas5-Apr-06 9:30
vineas5-Apr-06 9:30 
GeneralRe: Clearing event handlers Pin
Ed.Poore5-Apr-06 9:52
Ed.Poore5-Apr-06 9:52 
QuestionMDI Parent form with toolbars and menus Pin
snickel655-Apr-06 5:30
snickel655-Apr-06 5:30 
QuestionDoubleClick and MouseDown conflict Pin
cbeasle15-Apr-06 5:02
cbeasle15-Apr-06 5:02 
AnswerRe: DoubleClick and MouseDown conflict Pin
Judah Gabriel Himango5-Apr-06 5:07
sponsorJudah Gabriel Himango5-Apr-06 5:07 
GeneralRe: DoubleClick and MouseDown conflict Pin
cbeasle15-Apr-06 9:40
cbeasle15-Apr-06 9:40 
GeneralRe: DoubleClick and MouseDown conflict Pin
Judah Gabriel Himango5-Apr-06 12:12
sponsorJudah Gabriel Himango5-Apr-06 12:12 
GeneralRe: DoubleClick and MouseDown conflict Pin
h_sarandy8-Oct-10 20:46
h_sarandy8-Oct-10 20:46 
QuestionBrowsing to a location and selecting a file Pin
naglbitur5-Apr-06 4:31
naglbitur5-Apr-06 4:31 
AnswerRe: Browsing to a location and selecting a file Pin
V.5-Apr-06 4:37
professionalV.5-Apr-06 4:37 
AnswerRe: Browsing to a location and selecting a file Pin
J4amieC5-Apr-06 4:41
J4amieC5-Apr-06 4:41 
QuestionBrowsing to a location and selecting a file Pin
naglbitur5-Apr-06 4:30
naglbitur5-Apr-06 4:30 
AnswerRe: Browsing to a location and selecting a file Pin
Antony M Kancidrowski5-Apr-06 4:42
Antony M Kancidrowski5-Apr-06 4:42 
QuestionImport/Export registry section as xml file using C# code.. Pin
visala5-Apr-06 0:46
visala5-Apr-06 0:46 
QuestionWebservices & C# Pin
hung_ngole5-Apr-06 0:37
hung_ngole5-Apr-06 0:37 
AnswerRe: Webservices & C# Pin
Judah Gabriel Himango5-Apr-06 5:39
sponsorJudah Gabriel Himango5-Apr-06 5:39 

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.