Ignore Warning like in C++
-
Hi, is there a wax to tell the compiler to ignore a warning for a region of code, like it is possible in C++ like this:
#pragma warning( disable : 4705 ) ... // Some Code #pragma warning( default : 4705 )
Thanks for Help Greets Roland
Hi! I'm a signature virus. Copy me into your sig file and help me spread!
-
Hi, is there a wax to tell the compiler to ignore a warning for a region of code, like it is possible in C++ like this:
#pragma warning( disable : 4705 ) ... // Some Code #pragma warning( default : 4705 )
Thanks for Help Greets Roland
Hi! I'm a signature virus. Copy me into your sig file and help me spread!
See this article on MSDN #pragma warning disable 4705 and #pragma warning restore 4705 Gruß
-
See this article on MSDN #pragma warning disable 4705 and #pragma warning restore 4705 Gruß
Thank, but it looks like it is a feature added in .net 2.0. is there a way to do the same in .net 1.1 as i am stuck to it for this project... :( Greets Roland
Hi! I'm a signature virus. Copy me into your sig file and help me spread!
-
Thank, but it looks like it is a feature added in .net 2.0. is there a way to do the same in .net 1.1 as i am stuck to it for this project... :( Greets Roland
Hi! I'm a signature virus. Copy me into your sig file and help me spread!
-
The Warning CS0067: The event 'event' is never used. It is caused by a class dummy created for a test that implements an interface that contains this events. As some events are not relevant for the test they are not used. I can live with it but it would be nicer to have a 'clean' build. Greets Roland
Hi! I'm a signature virus. Copy me into your sig file and help me spread!
-
The Warning CS0067: The event 'event' is never used. It is caused by a class dummy created for a test that implements an interface that contains this events. As some events are not relevant for the test they are not used. I can live with it but it would be nicer to have a 'clean' build. Greets Roland
Hi! I'm a signature virus. Copy me into your sig file and help me spread!
You can write a protected or private OnEvent method. Its not that much code and should be done quickly even for some events by copy-and-paste. Furthermore, the methods may be useful, if you later on add more intelligence to the dummy or implement the final class.
private void OnEvent(EventArgs e)
{
if (this.Event!= null)
this.Event(this, e);
}
"Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning." - Rick Cook