using System; using System.Collections; using System.Runtime.InteropServices; namespace System.ComponentModel.Design { /// Represents a Windows menu or toolbar command item. // Token: 0x0200004E RID: 78 [ComVisible(true)] public class MenuCommand { /// Initializes a new instance of the class. /// The event to raise when the user selects the menu item or toolbar button. /// The unique command ID that links this menu command to the environment's menu. // Token: 0x0600031D RID: 797 RVA: 0x0000998C File Offset: 0x00007B8C public MenuCommand(EventHandler handler, CommandID command) { this.handler = handler; this.command = command; } /// Occurs when the menu command changes. // Token: 0x1400000F RID: 15 // (add) Token: 0x0600031E RID: 798 RVA: 0x000099B8 File Offset: 0x00007BB8 // (remove) Token: 0x0600031F RID: 799 RVA: 0x000099D4 File Offset: 0x00007BD4 public event EventHandler CommandChanged; /// Gets or sets a value indicating whether this menu item is checked. /// true if the item is checked; otherwise, false. // Token: 0x170000D9 RID: 217 // (get) Token: 0x06000320 RID: 800 RVA: 0x000099F0 File Offset: 0x00007BF0 // (set) Token: 0x06000321 RID: 801 RVA: 0x000099F8 File Offset: 0x00007BF8 public virtual bool Checked { get { return this.ischecked; } set { if (this.ischecked != value) { this.ischecked = value; this.OnCommandChanged(EventArgs.Empty); } } } /// Gets the associated with this menu command. /// The associated with the menu command. // Token: 0x170000DA RID: 218 // (get) Token: 0x06000322 RID: 802 RVA: 0x00009A18 File Offset: 0x00007C18 public virtual CommandID CommandID { get { return this.command; } } /// Gets a value indicating whether this menu item is available. /// true if the item is enabled; otherwise, false. // Token: 0x170000DB RID: 219 // (get) Token: 0x06000323 RID: 803 RVA: 0x00009A20 File Offset: 0x00007C20 // (set) Token: 0x06000324 RID: 804 RVA: 0x00009A28 File Offset: 0x00007C28 public virtual bool Enabled { get { return this.enabled; } set { if (this.enabled != value) { this.enabled = value; this.OnCommandChanged(EventArgs.Empty); } } } /// Gets the OLE command status code for this menu item. /// An integer containing a mixture of status flags that reflect the state of this menu item. // Token: 0x170000DC RID: 220 // (get) Token: 0x06000325 RID: 805 RVA: 0x00009A48 File Offset: 0x00007C48 [global::System.MonoTODO] public virtual int OleStatus { get { return 3; } } /// Gets the public properties associated with the . /// An containing the public properties of the . // Token: 0x170000DD RID: 221 // (get) Token: 0x06000326 RID: 806 RVA: 0x00009A4C File Offset: 0x00007C4C public virtual IDictionary Properties { get { if (this.properties == null) { this.properties = new Hashtable(); } return this.properties; } } /// Gets or sets a value indicating whether this menu item is supported. /// true if the item is supported, which is the default; otherwise, false. // Token: 0x170000DE RID: 222 // (get) Token: 0x06000327 RID: 807 RVA: 0x00009A6C File Offset: 0x00007C6C // (set) Token: 0x06000328 RID: 808 RVA: 0x00009A74 File Offset: 0x00007C74 public virtual bool Supported { get { return this.issupported; } set { this.issupported = value; } } /// Gets or sets a value indicating whether this menu item is visible. /// true if the item is visible; otherwise, false. // Token: 0x170000DF RID: 223 // (get) Token: 0x06000329 RID: 809 RVA: 0x00009A80 File Offset: 0x00007C80 // (set) Token: 0x0600032A RID: 810 RVA: 0x00009A88 File Offset: 0x00007C88 public virtual bool Visible { get { return this.visible; } set { this.visible = value; } } /// Invokes the command. // Token: 0x0600032B RID: 811 RVA: 0x00009A94 File Offset: 0x00007C94 public virtual void Invoke() { if (this.handler != null) { this.handler(this, EventArgs.Empty); } } /// Invokes the command with the given parameter. /// An optional argument for use by the command. // Token: 0x0600032C RID: 812 RVA: 0x00009AB4 File Offset: 0x00007CB4 public virtual void Invoke(object arg) { this.Invoke(); } /// Raises the event. /// An that contains the event data. // Token: 0x0600032D RID: 813 RVA: 0x00009ABC File Offset: 0x00007CBC protected virtual void OnCommandChanged(EventArgs e) { if (this.CommandChanged != null) { this.CommandChanged(this, e); } } /// Returns a string representation of this menu command. /// A string containing the value of the property appended with the names of any flags that are set, separated by pipe bars (|). These flag properties include , , , and . // Token: 0x0600032E RID: 814 RVA: 0x00009AD8 File Offset: 0x00007CD8 public override string ToString() { string text = string.Empty; if (this.command != null) { text = this.command.ToString(); } text += " : "; if (this.Supported) { text += "Supported"; } if (this.Enabled) { text += "|Enabled"; } if (this.Visible) { text += "|Visible"; } if (this.Checked) { text += "|Checked"; } return text; } // Token: 0x040000CB RID: 203 private EventHandler handler; // Token: 0x040000CC RID: 204 private CommandID command; // Token: 0x040000CD RID: 205 private bool ischecked; // Token: 0x040000CE RID: 206 private bool enabled = true; // Token: 0x040000CF RID: 207 private bool issupported = true; // Token: 0x040000D0 RID: 208 private bool visible = true; // Token: 0x040000D1 RID: 209 private Hashtable properties; } }