:
, int - - , . "" enum , int enum.
, , - : , intellisense , int :
public string Method1(myEnum myenum)
{
if(someBoolen)
return "test";
if(someOtherBoolean)
{
return "dfjakdsad";
}
else
{
string myStr = getString(myenum)
}
}
public string Method1(int someInt)
{
return Method1((myEnum) someInt);
}
Update: . When Adam asks, this decision really implies that you will always transmit intthat corresponds to your member enum. In my experience, this is common practice (if an enum only matches a subset of valid ints, then what value does the enum provide?) - but make sure that it matches your use case.
source
share