Re: Event never used warning message
From: Nicholas Paldino [.NET/C# MVP] (mvp_at_spam.guard.caspershouse.com)
Date: 11/02/04
- Next message: Jon Skeet [C# MVP]: "Re: Accessing static members of class in main Assembly"
- Previous message: Nicholas Paldino [.NET/C# MVP]: "Re: Scheduled task running at system startup and showing a UI"
- In reply to: Jack Addington: "Event never used warning message"
- Next in thread: Jack Addington: "Re: Event never used warning message"
- Reply: Jack Addington: "Re: Event never used warning message"
- Messages sorted by: [ date ] [ thread ]
Date: Tue, 2 Nov 2004 14:30:08 -0500
Jack,
I think the warning is because the event is never being fired anywhere
from within your class. The compiler is issuing the warning because it is
wondering why you have an event that you never fire.
You can go to the project properties and set it so that the compiler
will not issue warnings below a certain level. You can also include
warnings you would like to ignore. However, as a matter of general
principal, I would say that this is a bad thing. I would recommend treating
warnings as errors, and strive for no compilation errors.
Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mvp@spam.guard.caspershouse.com
"Jack Addington" <jaddington@shaw.ca> wrote in message
news:%23sacoMQwEHA.2728@TK2MSFTNGP12.phx.gbl...
>I have created an event and delegate combination for use in a user control
>when I place it on a form. However because I'm not actually doing anything
>in the event in the user object I didn't create any code for it.
>
> 1) How do I get rid of that warning (besides creating an empty
> declaration)
> 2) What is the best practice for declaring new events
>
> thx
>
> jack
>
- Next message: Jon Skeet [C# MVP]: "Re: Accessing static members of class in main Assembly"
- Previous message: Nicholas Paldino [.NET/C# MVP]: "Re: Scheduled task running at system startup and showing a UI"
- In reply to: Jack Addington: "Event never used warning message"
- Next in thread: Jack Addington: "Re: Event never used warning message"
- Reply: Jack Addington: "Re: Event never used warning message"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|