Files
Dec2017-Script-Dump/System/ComponentModel/Design/MenuCommand.cs
T
2026-06-04 11:42:34 +02:00

226 lines
7.0 KiB
C#

using System;
using System.Collections;
using System.Runtime.InteropServices;
namespace System.ComponentModel.Design
{
/// <summary>Represents a Windows menu or toolbar command item.</summary>
// Token: 0x0200004E RID: 78
[ComVisible(true)]
public class MenuCommand
{
/// <summary>Initializes a new instance of the <see cref="T:System.ComponentModel.Design.MenuCommand" /> class.</summary>
/// <param name="handler">The event to raise when the user selects the menu item or toolbar button. </param>
/// <param name="command">The unique command ID that links this menu command to the environment's menu. </param>
// Token: 0x0600031D RID: 797 RVA: 0x0000998C File Offset: 0x00007B8C
public MenuCommand(EventHandler handler, CommandID command)
{
this.handler = handler;
this.command = command;
}
/// <summary>Occurs when the menu command changes.</summary>
// 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;
/// <summary>Gets or sets a value indicating whether this menu item is checked.</summary>
/// <returns>true if the item is checked; otherwise, false.</returns>
// 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);
}
}
}
/// <summary>Gets the <see cref="T:System.ComponentModel.Design.CommandID" /> associated with this menu command.</summary>
/// <returns>The <see cref="T:System.ComponentModel.Design.CommandID" /> associated with the menu command.</returns>
// Token: 0x170000DA RID: 218
// (get) Token: 0x06000322 RID: 802 RVA: 0x00009A18 File Offset: 0x00007C18
public virtual CommandID CommandID
{
get
{
return this.command;
}
}
/// <summary>Gets a value indicating whether this menu item is available.</summary>
/// <returns>true if the item is enabled; otherwise, false.</returns>
// 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);
}
}
}
/// <summary>Gets the OLE command status code for this menu item.</summary>
/// <returns>An integer containing a mixture of status flags that reflect the state of this menu item.</returns>
// Token: 0x170000DC RID: 220
// (get) Token: 0x06000325 RID: 805 RVA: 0x00009A48 File Offset: 0x00007C48
[global::System.MonoTODO]
public virtual int OleStatus
{
get
{
return 3;
}
}
/// <summary>Gets the public properties associated with the <see cref="T:System.ComponentModel.Design.MenuCommand" />.</summary>
/// <returns>An <see cref="T:System.Collections.IDictionary" /> containing the public properties of the <see cref="T:System.ComponentModel.Design.MenuCommand" />. </returns>
// 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;
}
}
/// <summary>Gets or sets a value indicating whether this menu item is supported.</summary>
/// <returns>true if the item is supported, which is the default; otherwise, false.</returns>
// 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;
}
}
/// <summary>Gets or sets a value indicating whether this menu item is visible.</summary>
/// <returns>true if the item is visible; otherwise, false.</returns>
// 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;
}
}
/// <summary>Invokes the command.</summary>
// Token: 0x0600032B RID: 811 RVA: 0x00009A94 File Offset: 0x00007C94
public virtual void Invoke()
{
if (this.handler != null)
{
this.handler(this, EventArgs.Empty);
}
}
/// <summary>Invokes the command with the given parameter.</summary>
/// <param name="arg">An optional argument for use by the command.</param>
// Token: 0x0600032C RID: 812 RVA: 0x00009AB4 File Offset: 0x00007CB4
public virtual void Invoke(object arg)
{
this.Invoke();
}
/// <summary>Raises the <see cref="E:System.ComponentModel.Design.MenuCommand.CommandChanged" /> event.</summary>
/// <param name="e">An <see cref="T:System.EventArgs" /> that contains the event data. </param>
// Token: 0x0600032D RID: 813 RVA: 0x00009ABC File Offset: 0x00007CBC
protected virtual void OnCommandChanged(EventArgs e)
{
if (this.CommandChanged != null)
{
this.CommandChanged(this, e);
}
}
/// <summary>Returns a string representation of this menu command.</summary>
/// <returns>A string containing the value of the <see cref="P:System.ComponentModel.Design.MenuCommand.CommandID" /> property appended with the names of any flags that are set, separated by pipe bars (|). These flag properties include <see cref="P:System.ComponentModel.Design.MenuCommand.Checked" />, <see cref="P:System.ComponentModel.Design.MenuCommand.Enabled" />, <see cref="P:System.ComponentModel.Design.MenuCommand.Supported" />, and <see cref="P:System.ComponentModel.Design.MenuCommand.Visible" />.</returns>
// 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;
}
}