C# Type CustomAttributes
In this chapter you will learn:
Description
Type CustomAttributes
gets a collection that contains
this member's custom attributes.
Syntax
Type.CustomAttributes
has the following syntax.
public virtual IEnumerable<CustomAttributeData> CustomAttributes { get; }
Example
using System;// w w w . ja v a2 s.co m
public class MyClass1
{
public void MyMethod1()
{
}
}
class MyGetTypeFromCLSID
{
public static void Main()
{
Type myType = typeof(MyClass1);
Guid myGuid =(Guid) myType.GUID;
Console.WriteLine(myType.ToString());
Console.WriteLine(myType.CustomAttributes);
}
}
Next chapter...
What you will learn in the next chapter:
...
C# Type EmptyTypes
C# Type FilterAttribute
C# Type FilterName
C# Type FilterNameIgnoreCase
C# Type Missing
C# Type Assembly
C# Type AssemblyQualifiedName
C# Type Attributes
C# Type BaseType
C# Type ContainsGenericParameters
C# Type DeclaringType
C# Type DefaultBinder
C# Type FullName
C# Type GenericParameterAttributes
C# Type GenericParameterPosition
C# Type GenericTypeArguments
C# Type GUID
C# Type HasElementType
C# Type IsAbstract
C# Type IsAnsiClass
C# Type IsArray
C# Type IsAutoClass
C# Type IsAutoLayout
C# Type IsByRef
C# Type IsClass
C# Type IsCOMObject
C# Type IsConstructedGenericType
C# Type IsContextful
C# Type IsEnum
C# Type IsExplicitLayout
C# Type IsGenericParameter
C# Type IsGenericType
C# Type IsGenericTypeDefinition
C# Type IsImport
C# Type IsInterface
C# Type IsLayoutSequential
...
C# Type EmptyTypes
C# Type FilterAttribute
C# Type FilterName
C# Type FilterNameIgnoreCase
C# Type Missing
C# Type Assembly
C# Type AssemblyQualifiedName
C# Type Attributes
C# Type BaseType
C# Type ContainsGenericParameters
C# Type CustomAttributes
C# Type DeclaringMethodC# Type DeclaringType
C# Type DefaultBinder
C# Type FullName
C# Type GenericParameterAttributes
C# Type GenericParameterPosition
C# Type GenericTypeArguments
C# Type GUID
C# Type HasElementType
C# Type IsAbstract
C# Type IsAnsiClass
C# Type IsArray
C# Type IsAutoClass
C# Type IsAutoLayout
C# Type IsByRef
C# Type IsClass
C# Type IsCOMObject
C# Type IsConstructedGenericType
C# Type IsContextful
C# Type IsEnum
C# Type IsExplicitLayout
C# Type IsGenericParameter
C# Type IsGenericType
C# Type IsGenericTypeDefinition
C# Type IsImport
C# Type IsInterface
C# Type IsLayoutSequential
...