ClearScript Library
ClearScript Library
ClearScript Library Reference
Microsoft.ClearScript
CustomAttributeLoader Class
CustomAttributeLoader Methods
LoadCustomAttributes<T> Method

# CustomAttributeLoaderLoadCustomAttributes T Method

Loads custom attributes of the specified type for the given resource.
Namespace: Microsoft.ClearScript
Assembly: ClearScript.Core (in ClearScript.Core.dll) Version: 7.5.0
Syntax
C#
VB
C++
F#
Copy

    public virtual T[] LoadCustomAttributes<T>(
    	ICustomAttributeProvider resource,
    	bool inherit
    )
    where T : Attribute

    Public Overridable Function LoadCustomAttributes(Of T As Attribute) (
    	resource As ICustomAttributeProvider,
    	inherit As Boolean
    ) As T()

    public:
    generic<typename T>
    where T : Attribute
    virtual array<T>^ LoadCustomAttributes(
    	ICustomAttributeProvider^ resource,
    	bool inherit
    )

    abstract LoadCustomAttributes :
            resource : ICustomAttributeProvider *
            inherit : bool -> 'T[]  when 'T : Attribute
    override LoadCustomAttributes :
            resource : ICustomAttributeProvider *
            inherit : bool -> 'T[]  when 'T : Attribute

#### Parameters

resource ICustomAttributeProvider
  The resource for which to load custom attributes of type T.
inherit Boolean
  True to include custom attributes of type T defined for ancestors of resource, false otherwise.

#### Type Parameters

T
  The type, or a base type, of the custom attributes to load.

#### Return Value

T
An array of custom attributes of type T.
Remarks
This method is performance-critical. Overrides must not invoke script engine methods or other ClearScript functionality. The base implementation loads custom attributes via reflection.
See Also

#### Reference

CustomAttributeLoader Class
Microsoft.ClearScript Namespace

Copyright © Microsoft Corporation. All rights reserved.

Send comments on this topic to Microsoft