From msdn I get this:
#pragma warning disable warning-list
#pragma warning restore warning-list
In the examples, both disable
No, you'll find that the compiler will automatically restore any disabled warning once it's finished parsing a source file.
#pragma warning disable 649
struct MyInteropThing
{
int a;
int b;
}
#pragma warning restore 649
In the above example I've turned of warning CS00649 because I intend to use this struct in an unsafe manner. The compiler will not realize that I will be writing to memory that has this kind of layout so I'll want to ignore the warning:
Field 'field' is never assigned to, and will always have its default value 'value'
But I don't want the entire file to not be left unchecked.