mscorlib(4.0.0.0) API with additions
CommandID.cs
4 
6 {
8  [ComVisible(true)]
9  [HostProtection(SecurityAction.LinkDemand, SharedState = true)]
10  [PermissionSet(SecurityAction.LinkDemand, Name = "FullTrust")]
11  [PermissionSet(SecurityAction.InheritanceDemand, Name = "FullTrust")]
12  public class CommandID
13  {
14  private readonly Guid menuGroup;
15 
16  private readonly int commandID;
17 
20  public virtual int ID => commandID;
21 
24  public virtual Guid Guid => menuGroup;
25 
29  public CommandID(Guid menuGroup, int commandID)
30  {
31  this.menuGroup = menuGroup;
32  this.commandID = commandID;
33  }
34 
39  public override bool Equals(object obj)
40  {
41  if (!(obj is CommandID))
42  {
43  return false;
44  }
45  CommandID commandID = (CommandID)obj;
46  if (commandID.menuGroup.Equals(menuGroup))
47  {
48  return commandID.commandID == this.commandID;
49  }
50  return false;
51  }
52 
55  public override int GetHashCode()
56  {
57  return (menuGroup.GetHashCode() << 2) | commandID;
58  }
59 
62  public override string ToString()
63  {
64  return menuGroup.ToString() + " : " + commandID.ToString(CultureInfo.CurrentCulture);
65  }
66  }
67 }
Represents a unique command identifier that consists of a numeric command ID and a GUID menu group id...
Definition: CommandID.cs:12
Definition: __Canon.cs:3
virtual int ID
Gets the numeric command ID.
Definition: CommandID.cs:20
SecurityAction
Specifies the security actions that can be performed using declarative security.
Represents a globally unique identifier (GUID).To browse the .NET Framework source code for this type...
Definition: Guid.cs:14
override bool Equals(object o)
Returns a value that indicates whether this instance is equal to a specified object.
Definition: Guid.cs:986
CommandID(Guid menuGroup, int commandID)
Initializes a new instance of the T:System.ComponentModel.Design.CommandID class using the specified ...
Definition: CommandID.cs:29
override bool Equals(object obj)
Determines whether two T:System.ComponentModel.Design.CommandID instances are equal.
Definition: CommandID.cs:39
static CultureInfo CurrentCulture
Gets or sets the T:System.Globalization.CultureInfo object that represents the culture used by the cu...
Definition: CultureInfo.cs:120
override string ToString()
Returns a T:System.String that represents the current object.
Definition: CommandID.cs:62
override int GetHashCode()
Serves as a hash function for a particular type.
Definition: CommandID.cs:55
Provides information about a specific culture (called a locale for unmanaged code development)....
Definition: CultureInfo.cs:16