I have a base class like this:
public class BaseModalCommand
{
protected object m_commandArgument;
protected int m_commandID;
protected int m_
As best practice, your class fields should be marked as private and wrapped in a getter/setter property
so instead of
protected object m_commandArgument;
use
private object m_commandArgument;
protected object CommandArgument {get; set;}
Theres several advantages to this but a simple usage would be exception handling/validation in your setter.
e.g.
private string _email;
protected string Email
{
get { return _email; }
set
{
if(value.IndexOf("@") > 0)
_email = value;
else
throw new ArgumentException("Not a valid Email");
}
}