In C# one can always
#pragma warning disable ${list of warnings}
and #pragma warning restore ${list of warnings}
https://msdn.microsoft.com/en-us/library/441722ys.aspxAlthough frankly the list of warnings to disable and restore consists of warning numbers, not names, which is not super convenient.