I have a method with this signature:
public static void DirFillWEx(ComboBox cb, bool dirFill, bool fileFill);
this is put in a dll library I wrote myself. My question is: is there a way to instruct Visual Studio that this method cannot accept both the bool values as false, so I get an error at compile time (NOT RUNTIME!)?
For Example:
DirFillWEx(my_cb, false, true);
DirFillWEx(my_cb, true, true);
DirFillWEx(my_cb, true, false);
but not
DirFillWEx(my_cb, false, false);
Thank you all!
You could define an enum:
enum FillMode
{
Dir,
File,
Both
}
and then type your method to take the enum:
public static void DirFillWEx(ComboBox cb, FillMode fillMode);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With