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

128 lines
5.3 KiB
C#

using System;
namespace System.ComponentModel
{
/// <summary>Represents an attribute of a toolbox item.</summary>
// Token: 0x020000C4 RID: 196
[AttributeUsage(AttributeTargets.All)]
public class ToolboxItemAttribute : Attribute
{
/// <summary>Initializes a new instance of the <see cref="T:System.ComponentModel.ToolboxItemAttribute" /> class and specifies whether to use default initialization values.</summary>
/// <param name="defaultType">true to create a toolbox item attribute for a default type; false to associate no default toolbox item support for this attribute. </param>
// Token: 0x06000670 RID: 1648 RVA: 0x00010E54 File Offset: 0x0000F054
public ToolboxItemAttribute(bool defaultType)
{
if (defaultType)
{
this.itemTypeName = "System.Drawing.Design.ToolboxItem, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a";
}
}
/// <summary>Initializes a new instance of the <see cref="T:System.ComponentModel.ToolboxItemAttribute" /> class using the specified name of the type.</summary>
/// <param name="toolboxItemTypeName">The names of the type of the toolbox item and of the assembly that contains the type. </param>
// Token: 0x06000671 RID: 1649 RVA: 0x00010E70 File Offset: 0x0000F070
public ToolboxItemAttribute(string toolboxItemName)
{
this.itemTypeName = toolboxItemName;
}
/// <summary>Initializes a new instance of the <see cref="T:System.ComponentModel.ToolboxItemAttribute" /> class using the specified type of the toolbox item.</summary>
/// <param name="toolboxItemType">The type of the toolbox item. </param>
// Token: 0x06000672 RID: 1650 RVA: 0x00010E80 File Offset: 0x0000F080
public ToolboxItemAttribute(Type toolboxItemType)
{
this.itemType = toolboxItemType;
}
/// <summary>Gets or sets the type of the toolbox item.</summary>
/// <returns>The type of the toolbox item.</returns>
/// <exception cref="T:System.ArgumentException">The type cannot be found. </exception>
/// <PermissionSet>
/// <IPermission class="System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Flags="UnmanagedCode, ControlEvidence" />
/// </PermissionSet>
// Token: 0x170001AA RID: 426
// (get) Token: 0x06000674 RID: 1652 RVA: 0x00010EAC File Offset: 0x0000F0AC
public Type ToolboxItemType
{
get
{
if (this.itemType == null && this.itemTypeName != null)
{
try
{
this.itemType = Type.GetType(this.itemTypeName, true);
}
catch (Exception ex)
{
throw new ArgumentException("Failed to create ToolboxItem of type: " + this.itemTypeName, ex);
}
}
return this.itemType;
}
}
/// <summary>Gets or sets the name of the type of the current <see cref="T:System.Drawing.Design.ToolboxItem" />.</summary>
/// <returns>The fully qualified type name of the current toolbox item.</returns>
// Token: 0x170001AB RID: 427
// (get) Token: 0x06000675 RID: 1653 RVA: 0x00010F28 File Offset: 0x0000F128
public string ToolboxItemTypeName
{
get
{
if (this.itemTypeName == null)
{
if (this.itemType == null)
{
return string.Empty;
}
this.itemTypeName = this.itemType.AssemblyQualifiedName;
}
return this.itemTypeName;
}
}
/// <param name="obj">The object to compare.</param>
// Token: 0x06000676 RID: 1654 RVA: 0x00010F60 File Offset: 0x0000F160
public override bool Equals(object o)
{
ToolboxItemAttribute toolboxItemAttribute = o as ToolboxItemAttribute;
return toolboxItemAttribute != null && toolboxItemAttribute.ToolboxItemTypeName == this.ToolboxItemTypeName;
}
// Token: 0x06000677 RID: 1655 RVA: 0x00010F90 File Offset: 0x0000F190
public override int GetHashCode()
{
if (this.itemTypeName != null)
{
return this.itemTypeName.GetHashCode();
}
return base.GetHashCode();
}
/// <summary>Gets a value indicating whether the current value of the attribute is the default value for the attribute.</summary>
/// <returns>true if the current value of the attribute is the default; otherwise, false.</returns>
// Token: 0x06000678 RID: 1656 RVA: 0x00010FB0 File Offset: 0x0000F1B0
public override bool IsDefaultAttribute()
{
return this.Equals(ToolboxItemAttribute.Default);
}
// Token: 0x040001E2 RID: 482
private const string defaultItemType = "System.Drawing.Design.ToolboxItem, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a";
/// <summary>Initializes a new instance of the <see cref="T:System.ComponentModel.ToolboxItemAttribute" /> class and sets the type to the default, <see cref="T:System.Drawing.Design.ToolboxItem" />. This field is read-only.</summary>
// Token: 0x040001E3 RID: 483
public static readonly ToolboxItemAttribute Default = new ToolboxItemAttribute("System.Drawing.Design.ToolboxItem, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a");
/// <summary>Initializes a new instance of the <see cref="T:System.ComponentModel.ToolboxItemAttribute" /> class and sets the type to null. This field is read-only.</summary>
// Token: 0x040001E4 RID: 484
public static readonly ToolboxItemAttribute None = new ToolboxItemAttribute(false);
// Token: 0x040001E5 RID: 485
private Type itemType;
// Token: 0x040001E6 RID: 486
private string itemTypeName;
}
}