Click here to Skip to main content
16,006,440 members
Home / Discussions / C#
   

C#

 
AnswerRe: Richtext Box question Pin
mav.northwind26-Jan-06 6:13
mav.northwind26-Jan-06 6:13 
QuestionSplashScreen with Flash controle !!! Pin
CSharpJSharp25-Jan-06 6:55
CSharpJSharp25-Jan-06 6:55 
AnswerRe: SplashScreen with Flash controle !!! Pin
James Gupta25-Jan-06 8:34
professionalJames Gupta25-Jan-06 8:34 
GeneralRe: SplashScreen with Flash controle !!! Pin
CSharpJSharp25-Jan-06 23:35
CSharpJSharp25-Jan-06 23:35 
QuestionDouble buffering the scroll event of a RichTextBox Pin
dbaum25-Jan-06 6:44
dbaum25-Jan-06 6:44 
AnswerRe: Double buffering the scroll event of a RichTextBox Pin
DigitalKing25-Jan-06 9:43
DigitalKing25-Jan-06 9:43 
QuestionFire two events at the same time? Pin
Tom Wright25-Jan-06 6:41
Tom Wright25-Jan-06 6:41 
AnswerRe: Fire two events at the same time? Pin
Le centriste25-Jan-06 7:22
Le centriste25-Jan-06 7:22 
The only problem I see is your approach, if one of the 2 handlers is null, no event is fired. But that may be the intended behavior. If this is the case, that may confuse other parts of the application expecting to be notified of one event, but are not because nobody subscribed to the other one.

If this is the intended behavior, simply make one event: OnQResponseAndDataRecvd.

if ((segType == "Y") && (OnQResponseAndDataRecvd != null))
{
   OnQResponseAndDataRecvd(this, EventArgs.Empty);
}


If you need 2 separate events:

if (segType == "Y")
{
    if (OnQResponse != null) OnQResponse(this, EventArgs.Empty);
    if (OnDataRecvd != null) OnDataRecvd(this, EventArgs.Empty);
}



You may also notice the use of EventArgs.Empty instead of new EventArgs(). Basically, EventArgs is a class that contains no information, and this way you avoid creating unnecessary new objects.

--------

"I say no to drugs, but they don't listen."
- Marilyn Manson

-- modified at 13:23 Wednesday 25th January, 2006
AnswerRe: Fire two events at the same time? Pin
Guffa25-Jan-06 8:21
Guffa25-Jan-06 8:21 
GeneralRe: Fire two events at the same time? Pin
Tom Wright25-Jan-06 9:30
Tom Wright25-Jan-06 9:30 
GeneralRe: Fire two events at the same time? Pin
S. Senthil Kumar25-Jan-06 18:01
S. Senthil Kumar25-Jan-06 18:01 
QuestionSyntax Highlighting in VS Pin
the_traveller25-Jan-06 6:39
the_traveller25-Jan-06 6:39 
QuestionRowUpdating Event Pin
lordofcsharp25-Jan-06 4:38
lordofcsharp25-Jan-06 4:38 
AnswerRe: RowUpdating Event Pin
J4amieC25-Jan-06 4:51
J4amieC25-Jan-06 4:51 
GeneralRe: RowUpdating Event Pin
lordofcsharp25-Jan-06 5:01
lordofcsharp25-Jan-06 5:01 
QuestionNetSend problem Pin
razi3lll25-Jan-06 3:53
razi3lll25-Jan-06 3:53 
AnswerRe: NetSend problem Pin
Dave Kreskowiak25-Jan-06 4:28
mveDave Kreskowiak25-Jan-06 4:28 
QuestionHelp me Pin
ltxuan25-Jan-06 3:52
ltxuan25-Jan-06 3:52 
AnswerRe: Help me Pin
Dave Kreskowiak25-Jan-06 4:22
mveDave Kreskowiak25-Jan-06 4:22 
AnswerRe: Help me Pin
Drew McGhie25-Jan-06 9:20
Drew McGhie25-Jan-06 9:20 
QuestionConsole that changes directory. Pin
Mitchell McCollum25-Jan-06 3:20
Mitchell McCollum25-Jan-06 3:20 
AnswerRe: Console that changes directory. Pin
leppie25-Jan-06 3:41
leppie25-Jan-06 3:41 
AnswerRe: Console that changes directory. Pin
Dave Kreskowiak25-Jan-06 4:20
mveDave Kreskowiak25-Jan-06 4:20 
GeneralRe: Console that changes directory. Pin
Mitchell McCollum25-Jan-06 7:18
Mitchell McCollum25-Jan-06 7:18 
GeneralRe: Console that changes directory. Pin
SeanCM25-Jan-06 8:12
SeanCM25-Jan-06 8:12 

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.