Click here to Skip to main content
16,009,391 members
Home / Discussions / C#
   

C#

 
GeneralRe: Check presence of event handler attached to base class event Pin
jjansen3-Jul-06 1:06
jjansen3-Jul-06 1:06 
GeneralRe: Check presence of event handler attached to base class event Pin
Martin#3-Jul-06 1:17
Martin#3-Jul-06 1:17 
GeneralRe: Check presence of event handler attached to base class event Pin
jjansen3-Jul-06 1:28
jjansen3-Jul-06 1:28 
GeneralRe: Check presence of event handler attached to base class event Pin
Martin#3-Jul-06 1:47
Martin#3-Jul-06 1:47 
GeneralRe: Check presence of event handler attached to base class event Pin
jjansen3-Jul-06 1:50
jjansen3-Jul-06 1:50 
AnswerRe: Check presence of event handler attached to base class event Pin
J4amieC3-Jul-06 1:08
J4amieC3-Jul-06 1:08 
GeneralRe: Check presence of event handler attached to base class event Pin
jjansen3-Jul-06 1:11
jjansen3-Jul-06 1:11 
AnswerRe: Check presence of event handler attached to base class event [modified] Pin
Josh Smith3-Jul-06 4:18
Josh Smith3-Jul-06 4:18 
Use a little reflection to get the field which represents the Paint event, then (from within your control) access the protected Events property. Pass in the event field id and check if it returns null or not.

FieldInfo fi = typeof(Control).GetField( "EventPaint", BindingFlags.Static | BindingFlags.NonPublic );
object eventPaint = fi.GetValue( this );

this.Paint += new PaintEventHandler(Form1_Paint);
if( base.Events[eventPaint] == null )
{
	Debug.WriteLine( "No handlers attached to the Paint event." );
}
else
{
	Debug.WriteLine( "One or more handler is attached to the Paint event." );
}


:josh:
My WPF Blog[^]
GeneralRe: Check presence of event handler attached to base class event Pin
jjansen3-Jul-06 20:05
jjansen3-Jul-06 20:05 
AnswerRe: Check presence of event handler attached to base class event Pin
Andrew Lygin3-Jul-06 7:16
Andrew Lygin3-Jul-06 7:16 
GeneralRe: Check presence of event handler attached to base class event Pin
jjansen3-Jul-06 20:15
jjansen3-Jul-06 20:15 
QuestionMail Editor Like the one in Microsoft Outlook Pin
Sushant Duggal3-Jul-06 0:25
Sushant Duggal3-Jul-06 0:25 
GeneralRe: Mail Editor Like the one in Microsoft Outlook Pin
Andrew Lygin3-Jul-06 7:32
Andrew Lygin3-Jul-06 7:32 
GeneralRe: Mail Editor Like the one in Microsoft Outlook Pin
Dave Kreskowiak3-Jul-06 7:47
mveDave Kreskowiak3-Jul-06 7:47 
GeneralRe: Mail Editor Like the one in Microsoft Outlook Pin
Andrew Lygin3-Jul-06 8:13
Andrew Lygin3-Jul-06 8:13 
GeneralRe: Mail Editor Like the one in Microsoft Outlook Pin
Dave Kreskowiak3-Jul-06 17:36
mveDave Kreskowiak3-Jul-06 17:36 
GeneralRe: Mail Editor Like the one in Microsoft Outlook Pin
Andrew Lygin3-Jul-06 18:20
Andrew Lygin3-Jul-06 18:20 
QuestionHow to get a list of active USB and Floppy-devices? (2nt) Pin
Martin#3-Jul-06 0:10
Martin#3-Jul-06 0:10 
AnswerRe: How to get a list of active USB and Floppy-devices? (2nt) Pin
Tarakeshwar Reddy3-Jul-06 0:44
professionalTarakeshwar Reddy3-Jul-06 0:44 
GeneralRe: How to get a list of active USB and Floppy-devices? (2nt) Pin
Martin#3-Jul-06 0:49
Martin#3-Jul-06 0:49 
QuestionRe: How to get a list of active USB and Floppy-devices? (2nt) [modified] Pin
Martin#3-Jul-06 1:11
Martin#3-Jul-06 1:11 
AnswerRe: How to get a list of active USB and Floppy-devices? (2nt) [modified] Pin
Tarakeshwar Reddy3-Jul-06 1:35
professionalTarakeshwar Reddy3-Jul-06 1:35 
GeneralRe: How to get a list of active USB and Floppy-devices? (2nt) Pin
Martin#3-Jul-06 1:41
Martin#3-Jul-06 1:41 
GeneralRe: How to get a list of active USB and Floppy-devices? (2nt) [modified] Pin
Martin#3-Jul-06 1:44
Martin#3-Jul-06 1:44 
QuestionWhat can C# do project.?help. Pin
nguyenquang02842-Jul-06 22:17
nguyenquang02842-Jul-06 22:17 

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.