In C#, is there any way to throw a warning, like the ones the compiler gives you? Sort of like an exception, only not a fatal error, and the function can continue? For example, in my my connection sanity, I'd like to do something like this:
// Check for an illegal client.
if (!( m_sClient.Equals("RATS") || m_sClient.Equals("PXES") || m_sClient.Equals("NB2W") || m_sClient.Equals("VD2D") ||
m_sClient.Equals("PX2D") || m_sClient.Equals("3RAW") || m_sClient.Equals("PX3W")))
throw new ArgumentOutOfRangeException(null, "You have not selected a valid client. See the readme for more information.");
// LOOK AT ME
if (m_sClient.Equals("RATS") || m_sClient.Equals("PXES"))
throw new ConnectionWarning("StarCraft and Brood War are currently subject to checks by Blizzard's Wardent technology, "
+ "causing possible disconnections after a few minutes.");
// LOOK AT ME
// Check if they're attempting to use an SPR-related client (unsupported).
if (m_sClient.Equals("3RAW") || m_sClient.Equals("PX3W"))
throw new ArgumentOutOfRangeException(null, "The product you have selected has not had it's logon method implemented.");
(See the LOOK AT ME part in the middle)
Does anyone know of a way to do this?