I'm just busy writing a dialog box which needs a property to be set before ShowDialog is called. In the OnLoad, I'm checking whether it's been set and throwing an exception if it hasn't. Question is: which exception is most appropriate I'm leaning towards InvalidOperationException.
Of course, I could change the dialog's constructor to take the value as an argument, but I've got a notion that dialogs should provide a parameterless constructor --- is that right, or did I dream it

Exception opinions?
dickP
Please help my imagination, since I am constrained to think that the default value of the underlying type would be a ‘reasonable’ value If the type is a ‘pointer’ to a class or struct, I am stuck thinking of a ‘blankClass’ as a constant instance.
Alejandro B
Michael Springer
rf09
Why not provide two constructors: the first without arguments, which calls the second with a default value Then you can call it either way.
wandasoozq
Richard Watts
Gobi N
Demonslayer
I see.
Since this parameter would be ‘user data’ of a sort, I would validate it before I let it get anywhere near a dialog box.
Cammyr
surfguy0021
public class MyCustomDialogExceptionNeedsABetterName : System.Exception
{
Some properties describing error
}