mscorlib(4.0.0.0) API with additions
System.Diagnostics.SwitchAttribute Class Reference

Identifies a switch used in an assembly, class, or member. More...

Inheritance diagram for System.Diagnostics.SwitchAttribute:
[legend]
Collaboration diagram for System.Diagnostics.SwitchAttribute:
[legend]

Public Member Functions

 SwitchAttribute (string switchName, Type switchType)
 Initializes a new instance of the T:System.Diagnostics.SwitchAttribute class, specifying the name and the type of the switch. More...
 
- Public Member Functions inherited from System.Attribute
override bool Equals (object obj)
 Returns a value that indicates whether this instance is equal to a specified object. More...
 
override int GetHashCode ()
 Returns the hash code for this instance. More...
 
virtual bool Match (object obj)
 When overridden in a derived class, returns a value that indicates whether this instance equals a specified object. More...
 
virtual bool IsDefaultAttribute ()
 When overridden in a derived class, indicates whether the value of this instance is the default value for the derived class. More...
 

Static Public Member Functions

static SwitchAttribute [] GetAll (Assembly assembly)
 Returns all switch attributes for the specified assembly. More...
 
- Static Public Member Functions inherited from System.Attribute
static Attribute [] GetCustomAttributes (MemberInfo element, Type type)
 Retrieves an array of the custom attributes applied to a member of a type. Parameters specify the member, and the type of the custom attribute to search for. More...
 
static Attribute [] GetCustomAttributes (MemberInfo element, Type type, bool inherit)
 Retrieves an array of the custom attributes applied to a member of a type. Parameters specify the member, the type of the custom attribute to search for, and whether to search ancestors of the member. More...
 
static Attribute [] GetCustomAttributes (MemberInfo element)
 Retrieves an array of the custom attributes applied to a member of a type. A parameter specifies the member. More...
 
static Attribute [] GetCustomAttributes (MemberInfo element, bool inherit)
 Retrieves an array of the custom attributes applied to a member of a type. Parameters specify the member, the type of the custom attribute to search for, and whether to search ancestors of the member. More...
 
static bool IsDefined (MemberInfo element, Type attributeType)
 Determines whether any custom attributes are applied to a member of a type. Parameters specify the member, and the type of the custom attribute to search for. More...
 
static bool IsDefined (MemberInfo element, Type attributeType, bool inherit)
 Determines whether any custom attributes are applied to a member of a type. Parameters specify the member, the type of the custom attribute to search for, and whether to search ancestors of the member. More...
 
static Attribute GetCustomAttribute (MemberInfo element, Type attributeType)
 Retrieves a custom attribute applied to a member of a type. Parameters specify the member, and the type of the custom attribute to search for. More...
 
static Attribute GetCustomAttribute (MemberInfo element, Type attributeType, bool inherit)
 Retrieves a custom attribute applied to a member of a type. Parameters specify the member, the type of the custom attribute to search for, and whether to search ancestors of the member. More...
 
static Attribute [] GetCustomAttributes (ParameterInfo element)
 Retrieves an array of the custom attributes applied to a method parameter. A parameter specifies the method parameter. More...
 
static Attribute [] GetCustomAttributes (ParameterInfo element, Type attributeType)
 Retrieves an array of the custom attributes applied to a method parameter. Parameters specify the method parameter, and the type of the custom attribute to search for. More...
 
static Attribute [] GetCustomAttributes (ParameterInfo element, Type attributeType, bool inherit)
 Retrieves an array of the custom attributes applied to a method parameter. Parameters specify the method parameter, the type of the custom attribute to search for, and whether to search ancestors of the method parameter. More...
 
static Attribute [] GetCustomAttributes (ParameterInfo element, bool inherit)
 Retrieves an array of the custom attributes applied to a method parameter. Parameters specify the method parameter, and whether to search ancestors of the method parameter. More...
 
static bool IsDefined (ParameterInfo element, Type attributeType)
 Determines whether any custom attributes are applied to a method parameter. Parameters specify the method parameter, and the type of the custom attribute to search for. More...
 
static bool IsDefined (ParameterInfo element, Type attributeType, bool inherit)
 Determines whether any custom attributes are applied to a method parameter. Parameters specify the method parameter, the type of the custom attribute to search for, and whether to search ancestors of the method parameter. More...
 
static Attribute GetCustomAttribute (ParameterInfo element, Type attributeType)
 Retrieves a custom attribute applied to a method parameter. Parameters specify the method parameter, and the type of the custom attribute to search for. More...
 
static Attribute GetCustomAttribute (ParameterInfo element, Type attributeType, bool inherit)
 Retrieves a custom attribute applied to a method parameter. Parameters specify the method parameter, the type of the custom attribute to search for, and whether to search ancestors of the method parameter. More...
 
static Attribute [] GetCustomAttributes (Module element, Type attributeType)
 Retrieves an array of the custom attributes applied to a module. Parameters specify the module, and the type of the custom attribute to search for. More...
 
static Attribute [] GetCustomAttributes (Module element)
 Retrieves an array of the custom attributes applied to a module. A parameter specifies the module. More...
 
static Attribute [] GetCustomAttributes (Module element, bool inherit)
 Retrieves an array of the custom attributes applied to a module. Parameters specify the module, and an ignored search option. More...
 
static Attribute [] GetCustomAttributes (Module element, Type attributeType, bool inherit)
 Retrieves an array of the custom attributes applied to a module. Parameters specify the module, the type of the custom attribute to search for, and an ignored search option. More...
 
static bool IsDefined (Module element, Type attributeType)
 Determines whether any custom attributes of a specified type are applied to a module. Parameters specify the module, and the type of the custom attribute to search for. More...
 
static bool IsDefined (Module element, Type attributeType, bool inherit)
 Determines whether any custom attributes are applied to a module. Parameters specify the module, the type of the custom attribute to search for, and an ignored search option. More...
 
static Attribute GetCustomAttribute (Module element, Type attributeType)
 Retrieves a custom attribute applied to a module. Parameters specify the module, and the type of the custom attribute to search for. More...
 
static Attribute GetCustomAttribute (Module element, Type attributeType, bool inherit)
 Retrieves a custom attribute applied to a module. Parameters specify the module, the type of the custom attribute to search for, and an ignored search option. More...
 
static Attribute [] GetCustomAttributes (Assembly element, Type attributeType)
 Retrieves an array of the custom attributes applied to an assembly. Parameters specify the assembly, and the type of the custom attribute to search for. More...
 
static Attribute [] GetCustomAttributes (Assembly element, Type attributeType, bool inherit)
 Retrieves an array of the custom attributes applied to an assembly. Parameters specify the assembly, the type of the custom attribute to search for, and an ignored search option. More...
 
static Attribute [] GetCustomAttributes (Assembly element)
 Retrieves an array of the custom attributes applied to an assembly. A parameter specifies the assembly. More...
 
static Attribute [] GetCustomAttributes (Assembly element, bool inherit)
 Retrieves an array of the custom attributes applied to an assembly. Parameters specify the assembly, and an ignored search option. More...
 
static bool IsDefined (Assembly element, Type attributeType)
 Determines whether any custom attributes are applied to an assembly. Parameters specify the assembly, and the type of the custom attribute to search for. More...
 
static bool IsDefined (Assembly element, Type attributeType, bool inherit)
 Determines whether any custom attributes are applied to an assembly. Parameters specify the assembly, the type of the custom attribute to search for, and an ignored search option. More...
 
static Attribute GetCustomAttribute (Assembly element, Type attributeType)
 Retrieves a custom attribute applied to a specified assembly. Parameters specify the assembly and the type of the custom attribute to search for. More...
 
static Attribute GetCustomAttribute (Assembly element, Type attributeType, bool inherit)
 Retrieves a custom attribute applied to an assembly. Parameters specify the assembly, the type of the custom attribute to search for, and an ignored search option. More...
 

Properties

string SwitchName [get, set]
 Gets or sets the display name of the switch. More...
 
Type SwitchType [get, set]
 Gets or sets the type of the switch. More...
 
string SwitchDescription [get, set]
 Gets or sets the description of the switch. More...
 

Additional Inherited Members

- Public Attributes inherited from System.Attribute
virtual object TypeId => GetType()
 When implemented in a derived class, gets a unique identifier for this T:System.Attribute. More...
 
- Protected Member Functions inherited from System.Attribute
 Attribute ()
 Initializes a new instance of the T:System.Attribute class. More...
 

Detailed Description

Identifies a switch used in an assembly, class, or member.

Definition at line 8 of file SwitchAttribute.cs.

Constructor & Destructor Documentation

◆ SwitchAttribute()

System.Diagnostics.SwitchAttribute.SwitchAttribute ( string  switchName,
Type  switchType 
)

Initializes a new instance of the T:System.Diagnostics.SwitchAttribute class, specifying the name and the type of the switch.

Parameters
switchNameThe display name of the switch.
switchTypeThe type of the switch.

Definition at line 79 of file SwitchAttribute.cs.

Member Function Documentation

◆ GetAll()

static SwitchAttribute [] System.Diagnostics.SwitchAttribute.GetAll ( Assembly  assembly)
static

Returns all switch attributes for the specified assembly.

Parameters
assemblyThe assembly to check for switch attributes.
Returns
An array that contains all the switch attributes for the assembly.
Exceptions
T:System.ArgumentNullExceptionassembly is null.

Definition at line 90 of file SwitchAttribute.cs.

Property Documentation

◆ SwitchDescription

string System.Diagnostics.SwitchAttribute.SwitchDescription
getset

Gets or sets the description of the switch.

Returns
The description of the switch.

Definition at line 65 of file SwitchAttribute.cs.

◆ SwitchName

string System.Diagnostics.SwitchAttribute.SwitchName
getset

Gets or sets the display name of the switch.

Returns
The display name of the switch.
Exceptions
T:System.ArgumentNullExceptionP:System.Diagnostics.SwitchAttribute.SwitchName is set to null.
T:System.ArgumentExceptionP:System.Diagnostics.SwitchAttribute.SwitchName is set to an empty string.

Definition at line 23 of file SwitchAttribute.cs.

◆ SwitchType

Type System.Diagnostics.SwitchAttribute.SwitchType
getset

Gets or sets the type of the switch.

Returns
The type of the switch.
Exceptions
T:System.ArgumentNullExceptionP:System.Diagnostics.SwitchAttribute.SwitchType is set to null.

Definition at line 47 of file SwitchAttribute.cs.


The documentation for this class was generated from the following file: