Windows apps
Collapse the table of content
Expand the table of content
Information
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

Assembly::IsDefined Method (Type^, Boolean)

 

Indicates whether or not a specified attribute has been applied to the assembly.

Namespace:   System.Reflection
Assembly:  mscorlib (in mscorlib.dll)

public:
virtual bool IsDefined(
	Type^ attributeType,
	bool inherit
)

Parameters

attributeType
Type: System::Type^

The type of the attribute to be checked for this assembly.

inherit
Type: System::Boolean

This argument is ignored for objects of this type.

Return Value

Type: System::Boolean

true if the attribute has been applied to the assembly; otherwise, false.

Exception Condition
ArgumentNullException

attributeType is null.

ArgumentException

attributeType uses an invalid type.

The following code example applies the AssemblyTitleAttribute attribute to an assembly and then uses IsDefined to indicate whether it was applied. It also tests an attribute that was not applied.

No code example is currently available or this language may not be supported.

.NET Framework
Available since 1.1
Portable Class Library
Supported in: portable .NET platforms
Silverlight
Available since 2.0
Windows Phone Silverlight
Available since 7.0
Return to top
Show:
© 2017 Microsoft