public override string ToString()
{
// MS runtime produces a NullReferenceException here if CommandID property == null
// which I guess isn't a good idea (throwing exceptions in ToStrings???) - bug in MS??
string commandpart = string.Empty;
if (command != null)
{
commandpart = command.ToString();
}
commandpart = string.Concat(commandpart, " : ");
if (this.Supported)
{
commandpart = string.Concat(commandpart, "Supported");
}
if (this.Enabled)
{
commandpart = string.Concat(commandpart, "|Enabled");
}
if (this.Visible)
{
commandpart = string.Concat(commandpart, "|Visible");
}
if (this.Checked)
{
commandpart = string.Concat(commandpart, "|Checked");
}
return(commandpart);
}