Files
2026-06-04 11:42:34 +02:00

101 lines
3.9 KiB
C#

using System;
namespace System.ComponentModel
{
/// <summary>Specifies the filter string and filter type to use for a toolbox item.</summary>
// Token: 0x020000C5 RID: 197
[AttributeUsage(AttributeTargets.Class, AllowMultiple = true, Inherited = true)]
[Serializable]
public sealed class ToolboxItemFilterAttribute : Attribute
{
/// <summary>Initializes a new instance of the <see cref="T:System.ComponentModel.ToolboxItemFilterAttribute" /> class using the specified filter string.</summary>
/// <param name="filterString">The filter string for the toolbox item. </param>
// Token: 0x06000679 RID: 1657 RVA: 0x00010FC0 File Offset: 0x0000F1C0
public ToolboxItemFilterAttribute(string filterString)
{
this.Filter = filterString;
this.ItemFilterType = ToolboxItemFilterType.Allow;
}
/// <summary>Initializes a new instance of the <see cref="T:System.ComponentModel.ToolboxItemFilterAttribute" /> class using the specified filter string and type.</summary>
/// <param name="filterString">The filter string for the toolbox item. </param>
/// <param name="filterType">A <see cref="T:System.ComponentModel.ToolboxItemFilterType" /> indicating the type of the filter. </param>
// Token: 0x0600067A RID: 1658 RVA: 0x00010FD8 File Offset: 0x0000F1D8
public ToolboxItemFilterAttribute(string filterString, ToolboxItemFilterType filterType)
{
this.Filter = filterString;
this.ItemFilterType = filterType;
}
/// <summary>Gets the filter string for the toolbox item.</summary>
/// <returns>The filter string for the toolbox item.</returns>
// Token: 0x170001AC RID: 428
// (get) Token: 0x0600067B RID: 1659 RVA: 0x00010FF0 File Offset: 0x0000F1F0
public string FilterString
{
get
{
return this.Filter;
}
}
/// <summary>Gets the type of the filter.</summary>
/// <returns>A <see cref="T:System.ComponentModel.ToolboxItemFilterType" /> that indicates the type of the filter.</returns>
// Token: 0x170001AD RID: 429
// (get) Token: 0x0600067C RID: 1660 RVA: 0x00010FF8 File Offset: 0x0000F1F8
public ToolboxItemFilterType FilterType
{
get
{
return this.ItemFilterType;
}
}
/// <summary>Gets the type ID for the attribute.</summary>
/// <returns>The type ID for this attribute. All <see cref="T:System.ComponentModel.ToolboxItemFilterAttribute" /> objects with the same filter string return the same type ID.</returns>
// Token: 0x170001AE RID: 430
// (get) Token: 0x0600067D RID: 1661 RVA: 0x00011000 File Offset: 0x0000F200
public override object TypeId
{
get
{
return base.TypeId + this.Filter;
}
}
/// <param name="obj">The object to compare.</param>
// Token: 0x0600067E RID: 1662 RVA: 0x00011014 File Offset: 0x0000F214
public override bool Equals(object obj)
{
return obj is ToolboxItemFilterAttribute && (obj == this || (((ToolboxItemFilterAttribute)obj).FilterString == this.Filter && ((ToolboxItemFilterAttribute)obj).FilterType == this.ItemFilterType));
}
// Token: 0x0600067F RID: 1663 RVA: 0x00011068 File Offset: 0x0000F268
public override int GetHashCode()
{
return this.ToString().GetHashCode();
}
/// <summary>Indicates whether the specified object has a matching filter string.</summary>
/// <returns>true if the specified object has a matching filter string; otherwise, false.</returns>
/// <param name="obj">The object to test for a matching filter string. </param>
// Token: 0x06000680 RID: 1664 RVA: 0x00011078 File Offset: 0x0000F278
public override bool Match(object obj)
{
return obj is ToolboxItemFilterAttribute && ((ToolboxItemFilterAttribute)obj).FilterString == this.Filter;
}
// Token: 0x06000681 RID: 1665 RVA: 0x000110A0 File Offset: 0x0000F2A0
public override string ToString()
{
return string.Format("{0},{1}", this.Filter, this.ItemFilterType);
}
// Token: 0x040001E7 RID: 487
private string Filter;
// Token: 0x040001E8 RID: 488
private ToolboxItemFilterType ItemFilterType;
}
}