Click here to Skip to main content
15,920,438 members
Home / Discussions / C#
   

C#

 
AnswerRe: how kill a thread that is on wait state?????? Pin
dan!sh 18-Aug-08 10:02
professional dan!sh 18-Aug-08 10:02 
Questioncan we retrieve source code of an exe file that compiled with c#.net 2005???? Pin
mr.mohsen18-Aug-08 9:17
mr.mohsen18-Aug-08 9:17 
AnswerRe: can we retrieve source code of an exe file that compiled with c#.net 2005???? Pin
Wendelius18-Aug-08 9:22
mentorWendelius18-Aug-08 9:22 
AnswerRe: can we retrieve source code of an exe file that compiled with c#.net 2005???? Pin
JoeRip18-Aug-08 11:24
JoeRip18-Aug-08 11:24 
QuestionEvents Pin
CodingYoshi18-Aug-08 4:56
CodingYoshi18-Aug-08 4:56 
QuestionRe: Events Pin
led mike18-Aug-08 5:02
led mike18-Aug-08 5:02 
AnswerRe: Events Pin
Thomas Stockwell18-Aug-08 5:37
professionalThomas Stockwell18-Aug-08 5:37 
GeneralRe: Events Pin
CodingYoshi18-Aug-08 6:19
CodingYoshi18-Aug-08 6:19 
I have all that but for some reason when checking for a handler it returns null. Here is the complete code for this portion of the C# class responsible for raising the event:

public delegate void ValidityChanged(object sender, EventArgs e);

public event ValidityChanged Validated;
public event ValidityChanged Invalidated;

Within a method when the object changes I call this:
OnValidated(EventArgs.Empty);

public void OnValidated(EventArgs e)
{
RaiseEvent(Validated, e);
}

protected void RaiseEvent(ValidityChanged handler, EventArgs e)
{
if (handler != null) // this is false although I create a handler below in the vb code
{
handler(this, EventArgs.Empty);
}
}

This is the vb.net code for handling:

Imagine the above C# class's name is SizeRun

Dim run as SizeRun = new SizeRun()
AddHandler run.Validated, AddressOf SizeRun_Validated

Private Sub SizeRun_Validated(ByVal sender As System.Object, ByVal e As System.EventArgs)
' handle the event
End Sub
GeneralRe: Events Pin
DaveyM6918-Aug-08 7:59
professionalDaveyM6918-Aug-08 7:59 
GeneralRe: Events Pin
led mike18-Aug-08 8:48
led mike18-Aug-08 8:48 
GeneralRe: Events Pin
CodingYoshi18-Aug-08 9:35
CodingYoshi18-Aug-08 9:35 
GeneralRe: Events Pin
led mike18-Aug-08 11:21
led mike18-Aug-08 11:21 
QuestionIndexers [modified] Pin
c242318-Aug-08 4:50
c242318-Aug-08 4:50 
AnswerRe: Indexers Pin
led mike18-Aug-08 4:59
led mike18-Aug-08 4:59 
GeneralRe: Indexers Pin
c242318-Aug-08 5:04
c242318-Aug-08 5:04 
GeneralRe: Indexers Pin
led mike18-Aug-08 9:00
led mike18-Aug-08 9:00 
AnswerRe: Indexers Pin
User 665818-Aug-08 5:05
User 665818-Aug-08 5:05 
GeneralRe: Indexers Pin
c242318-Aug-08 5:17
c242318-Aug-08 5:17 
GeneralRe: Indexers Pin
User 665818-Aug-08 5:34
User 665818-Aug-08 5:34 
GeneralRe: Indexers Pin
c242318-Aug-08 5:51
c242318-Aug-08 5:51 
GeneralRe: Indexers Pin
User 665818-Aug-08 6:03
User 665818-Aug-08 6:03 
GeneralRe: Indexers Pin
Dr. Emmett Brown18-Aug-08 9:03
Dr. Emmett Brown18-Aug-08 9:03 
GeneralRe: Indexers Pin
c242319-Aug-08 5:16
c242319-Aug-08 5:16 
GeneralRe: Indexers Pin
c242319-Aug-08 5:15
c242319-Aug-08 5:15 
QuestionDateTime control issue Pin
laziale18-Aug-08 4:37
laziale18-Aug-08 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.