Share via


CustomAttributeExtensions.GetCustomAttributes Metode

Definisi

Mengambil kumpulan atribut kustom yang diterapkan ke elemen tertentu.

Overload

GetCustomAttributes(ParameterInfo, Type, Boolean)

Mengambil kumpulan atribut kustom dari jenis tertentu yang diterapkan ke parameter tertentu, dan secara opsional memeriksa leluhur parameter tersebut.

GetCustomAttributes(MemberInfo, Type, Boolean)

Mengambil kumpulan atribut kustom dari jenis tertentu yang diterapkan ke anggota tertentu, dan secara opsional memeriksa leluhur anggota tersebut.

GetCustomAttributes(ParameterInfo, Type)

Mengambil kumpulan atribut kustom dari jenis tertentu yang diterapkan ke parameter tertentu.

GetCustomAttributes(ParameterInfo, Boolean)

Mengambil kumpulan atribut kustom yang diterapkan ke parameter tertentu, dan secara opsional memeriksa leluhur parameter tersebut.

GetCustomAttributes(Module, Type)

Mengambil kumpulan atribut kustom dari jenis tertentu yang diterapkan ke modul tertentu.

GetCustomAttributes(MemberInfo, Type)

Mengambil kumpulan atribut kustom dari jenis tertentu yang diterapkan ke anggota tertentu.

GetCustomAttributes(MemberInfo, Boolean)

Mengambil kumpulan atribut kustom yang diterapkan ke anggota tertentu, dan secara opsional memeriksa leluhur anggota tersebut.

GetCustomAttributes(Assembly, Type)

Mengambil kumpulan atribut kustom dari jenis tertentu yang diterapkan ke rakitan tertentu.

GetCustomAttributes(ParameterInfo)

Mengambil kumpulan atribut kustom yang diterapkan ke parameter tertentu.

GetCustomAttributes(Module)

Mengambil kumpulan atribut kustom yang diterapkan ke modul tertentu.

GetCustomAttributes(MemberInfo)

Mengambil kumpulan atribut kustom yang diterapkan ke anggota tertentu.

GetCustomAttributes(Assembly)

Mengambil kumpulan atribut kustom yang diterapkan ke rakitan tertentu.

GetCustomAttributes<T>(ParameterInfo, Boolean)

Mengambil kumpulan atribut kustom dari jenis tertentu yang diterapkan ke parameter tertentu, dan secara opsional memeriksa leluhur parameter tersebut.

GetCustomAttributes<T>(MemberInfo, Boolean)

Mengambil kumpulan atribut kustom dari jenis tertentu yang diterapkan ke anggota tertentu, dan secara opsional memeriksa leluhur anggota tersebut.

GetCustomAttributes<T>(ParameterInfo)

Mengambil kumpulan atribut kustom dari jenis tertentu yang diterapkan ke parameter tertentu.

GetCustomAttributes<T>(MemberInfo)

Mengambil kumpulan atribut kustom dari jenis tertentu yang diterapkan ke anggota tertentu.

GetCustomAttributes<T>(Assembly)

Mengambil kumpulan atribut kustom dari jenis tertentu yang diterapkan ke rakitan tertentu.

GetCustomAttributes<T>(Module)

Mengambil kumpulan atribut kustom dari jenis tertentu yang diterapkan ke modul tertentu.

GetCustomAttributes(ParameterInfo, Type, Boolean)

Sumber:
CustomAttributeExtensions.cs
Sumber:
CustomAttributeExtensions.cs
Sumber:
CustomAttributeExtensions.cs

Mengambil kumpulan atribut kustom dari jenis tertentu yang diterapkan ke parameter tertentu, dan secara opsional memeriksa leluhur parameter tersebut.

public:
[System::Runtime::CompilerServices::Extension]
 static System::Collections::Generic::IEnumerable<Attribute ^> ^ GetCustomAttributes(System::Reflection::ParameterInfo ^ element, Type ^ attributeType, bool inherit);
public static System.Collections.Generic.IEnumerable<Attribute> GetCustomAttributes (this System.Reflection.ParameterInfo element, Type attributeType, bool inherit);
static member GetCustomAttributes : System.Reflection.ParameterInfo * Type * bool -> seq<Attribute>
<Extension()>
Public Function GetCustomAttributes (element As ParameterInfo, attributeType As Type, inherit As Boolean) As IEnumerable(Of Attribute)

Parameter

element
ParameterInfo

Parameter yang akan diperiksa.

attributeType
Type

Jenis atribut yang akan dicari.

inherit
Boolean

true untuk memeriksa leluhur element; jika tidak, false.

Mengembalikan

Kumpulan atribut kustom yang diterapkan ke dan yang cocok attributeTypedengan element , atau koleksi kosong jika tidak ada atribut tersebut.

Pengecualian

element atau attributeType adalah null.

attributeType tidak berasal dari Attribute.

element bukan konstruktor, metode, properti, peristiwa, jenis, atau bidang.

Jenis atribut kustom tidak dapat dimuat.

Berlaku untuk

GetCustomAttributes(MemberInfo, Type, Boolean)

Sumber:
CustomAttributeExtensions.cs
Sumber:
CustomAttributeExtensions.cs
Sumber:
CustomAttributeExtensions.cs

Mengambil kumpulan atribut kustom dari jenis tertentu yang diterapkan ke anggota tertentu, dan secara opsional memeriksa leluhur anggota tersebut.

public:
[System::Runtime::CompilerServices::Extension]
 static System::Collections::Generic::IEnumerable<Attribute ^> ^ GetCustomAttributes(System::Reflection::MemberInfo ^ element, Type ^ attributeType, bool inherit);
public static System.Collections.Generic.IEnumerable<Attribute> GetCustomAttributes (this System.Reflection.MemberInfo element, Type attributeType, bool inherit);
static member GetCustomAttributes : System.Reflection.MemberInfo * Type * bool -> seq<Attribute>
<Extension()>
Public Function GetCustomAttributes (element As MemberInfo, attributeType As Type, inherit As Boolean) As IEnumerable(Of Attribute)

Parameter

element
MemberInfo

Anggota yang akan diperiksa.

attributeType
Type

Jenis atribut yang akan dicari.

inherit
Boolean

true untuk memeriksa leluhur element; jika tidak, false.

Mengembalikan

Kumpulan atribut kustom yang diterapkan ke dan yang cocok attributeTypedengan element , atau koleksi kosong jika tidak ada atribut tersebut.

Pengecualian

element atau attributeType adalah null.

attributeType tidak berasal dari Attribute.

element bukan konstruktor, metode, properti, peristiwa, jenis, atau bidang.

Jenis atribut kustom tidak dapat dimuat.

Berlaku untuk

GetCustomAttributes(ParameterInfo, Type)

Sumber:
CustomAttributeExtensions.cs
Sumber:
CustomAttributeExtensions.cs
Sumber:
CustomAttributeExtensions.cs

Mengambil kumpulan atribut kustom dari jenis tertentu yang diterapkan ke parameter tertentu.

public:
[System::Runtime::CompilerServices::Extension]
 static System::Collections::Generic::IEnumerable<Attribute ^> ^ GetCustomAttributes(System::Reflection::ParameterInfo ^ element, Type ^ attributeType);
public static System.Collections.Generic.IEnumerable<Attribute> GetCustomAttributes (this System.Reflection.ParameterInfo element, Type attributeType);
static member GetCustomAttributes : System.Reflection.ParameterInfo * Type -> seq<Attribute>
<Extension()>
Public Function GetCustomAttributes (element As ParameterInfo, attributeType As Type) As IEnumerable(Of Attribute)

Parameter

element
ParameterInfo

Parameter yang akan diperiksa.

attributeType
Type

Jenis atribut yang akan dicari.

Mengembalikan

Kumpulan atribut kustom yang diterapkan ke dan yang cocok attributeTypedengan element , atau koleksi kosong jika tidak ada atribut tersebut.

Pengecualian

element atau attributeType adalah null.

attributeType tidak berasal dari Attribute.

element bukan konstruktor, metode, properti, peristiwa, jenis, atau bidang.

Jenis atribut kustom tidak dapat dimuat.

Berlaku untuk

GetCustomAttributes(ParameterInfo, Boolean)

Sumber:
CustomAttributeExtensions.cs
Sumber:
CustomAttributeExtensions.cs
Sumber:
CustomAttributeExtensions.cs

Mengambil kumpulan atribut kustom yang diterapkan ke parameter tertentu, dan secara opsional memeriksa leluhur parameter tersebut.

public:
[System::Runtime::CompilerServices::Extension]
 static System::Collections::Generic::IEnumerable<Attribute ^> ^ GetCustomAttributes(System::Reflection::ParameterInfo ^ element, bool inherit);
public static System.Collections.Generic.IEnumerable<Attribute> GetCustomAttributes (this System.Reflection.ParameterInfo element, bool inherit);
static member GetCustomAttributes : System.Reflection.ParameterInfo * bool -> seq<Attribute>
<Extension()>
Public Function GetCustomAttributes (element As ParameterInfo, inherit As Boolean) As IEnumerable(Of Attribute)

Parameter

element
ParameterInfo

Parameter yang akan diperiksa.

inherit
Boolean

true untuk memeriksa leluhur element; jika tidak, false.

Mengembalikan

Kumpulan atribut kustom yang diterapkan ke element, atau koleksi kosong jika tidak ada atribut tersebut.

Pengecualian

elementadalah null.

element bukan konstruktor, metode, properti, peristiwa, jenis, atau bidang.

Jenis atribut kustom tidak dapat dimuat.

Berlaku untuk

GetCustomAttributes(Module, Type)

Sumber:
CustomAttributeExtensions.cs
Sumber:
CustomAttributeExtensions.cs
Sumber:
CustomAttributeExtensions.cs

Mengambil kumpulan atribut kustom dari jenis tertentu yang diterapkan ke modul tertentu.

public:
[System::Runtime::CompilerServices::Extension]
 static System::Collections::Generic::IEnumerable<Attribute ^> ^ GetCustomAttributes(System::Reflection::Module ^ element, Type ^ attributeType);
public static System.Collections.Generic.IEnumerable<Attribute> GetCustomAttributes (this System.Reflection.Module element, Type attributeType);
static member GetCustomAttributes : System.Reflection.Module * Type -> seq<Attribute>
<Extension()>
Public Function GetCustomAttributes (element As Module, attributeType As Type) As IEnumerable(Of Attribute)

Parameter

element
Module

Modul yang akan diperiksa.

attributeType
Type

Jenis atribut yang akan dicari.

Mengembalikan

Kumpulan atribut kustom yang diterapkan ke dan yang cocok attributeTypedengan element , atau koleksi kosong jika tidak ada atribut tersebut.

Pengecualian

element atau attributeType adalah null.

attributeType tidak berasal dari Attribute.

Berlaku untuk

GetCustomAttributes(MemberInfo, Type)

Sumber:
CustomAttributeExtensions.cs
Sumber:
CustomAttributeExtensions.cs
Sumber:
CustomAttributeExtensions.cs

Mengambil kumpulan atribut kustom dari jenis tertentu yang diterapkan ke anggota tertentu.

public:
[System::Runtime::CompilerServices::Extension]
 static System::Collections::Generic::IEnumerable<Attribute ^> ^ GetCustomAttributes(System::Reflection::MemberInfo ^ element, Type ^ attributeType);
public static System.Collections.Generic.IEnumerable<Attribute> GetCustomAttributes (this System.Reflection.MemberInfo element, Type attributeType);
static member GetCustomAttributes : System.Reflection.MemberInfo * Type -> seq<Attribute>
<Extension()>
Public Function GetCustomAttributes (element As MemberInfo, attributeType As Type) As IEnumerable(Of Attribute)

Parameter

element
MemberInfo

Anggota yang akan diperiksa.

attributeType
Type

Jenis atribut yang akan dicari.

Mengembalikan

Kumpulan atribut kustom yang diterapkan ke dan yang cocok attributeTypedengan element , atau koleksi kosong jika tidak ada atribut tersebut.

Pengecualian

element atau attributeType adalah null.

attributeType tidak berasal dari Attribute.

element bukan konstruktor, metode, properti, peristiwa, jenis, atau bidang.

Jenis atribut kustom tidak dapat dimuat.

Berlaku untuk

GetCustomAttributes(MemberInfo, Boolean)

Sumber:
CustomAttributeExtensions.cs
Sumber:
CustomAttributeExtensions.cs
Sumber:
CustomAttributeExtensions.cs

Mengambil kumpulan atribut kustom yang diterapkan ke anggota tertentu, dan secara opsional memeriksa leluhur anggota tersebut.

public:
[System::Runtime::CompilerServices::Extension]
 static System::Collections::Generic::IEnumerable<Attribute ^> ^ GetCustomAttributes(System::Reflection::MemberInfo ^ element, bool inherit);
public static System.Collections.Generic.IEnumerable<Attribute> GetCustomAttributes (this System.Reflection.MemberInfo element, bool inherit);
static member GetCustomAttributes : System.Reflection.MemberInfo * bool -> seq<Attribute>
<Extension()>
Public Function GetCustomAttributes (element As MemberInfo, inherit As Boolean) As IEnumerable(Of Attribute)

Parameter

element
MemberInfo

Anggota yang akan diperiksa.

inherit
Boolean

true untuk memeriksa leluhur element; jika tidak, false.

Mengembalikan

Kumpulan atribut kustom yang diterapkan ke yang cocok dengan element kriteria yang ditentukan, atau koleksi kosong jika tidak ada atribut tersebut.

Pengecualian

elementadalah null.

element bukan konstruktor, metode, properti, peristiwa, jenis, atau bidang.

Jenis atribut kustom tidak dapat dimuat.

Berlaku untuk

GetCustomAttributes(Assembly, Type)

Sumber:
CustomAttributeExtensions.cs
Sumber:
CustomAttributeExtensions.cs
Sumber:
CustomAttributeExtensions.cs

Mengambil kumpulan atribut kustom dari jenis tertentu yang diterapkan ke rakitan tertentu.

public:
[System::Runtime::CompilerServices::Extension]
 static System::Collections::Generic::IEnumerable<Attribute ^> ^ GetCustomAttributes(System::Reflection::Assembly ^ element, Type ^ attributeType);
public static System.Collections.Generic.IEnumerable<Attribute> GetCustomAttributes (this System.Reflection.Assembly element, Type attributeType);
static member GetCustomAttributes : System.Reflection.Assembly * Type -> seq<Attribute>
<Extension()>
Public Function GetCustomAttributes (element As Assembly, attributeType As Type) As IEnumerable(Of Attribute)

Parameter

element
Assembly

Perakitan untuk diperiksa.

attributeType
Type

Jenis atribut yang akan dicari.

Mengembalikan

Kumpulan atribut kustom yang diterapkan ke dan yang cocok attributeTypedengan element , atau koleksi kosong jika tidak ada atribut tersebut.

Pengecualian

element atau attributeType adalah null.

attributeType tidak berasal dari Attribute.

Berlaku untuk

GetCustomAttributes(ParameterInfo)

Sumber:
CustomAttributeExtensions.cs
Sumber:
CustomAttributeExtensions.cs
Sumber:
CustomAttributeExtensions.cs

Mengambil kumpulan atribut kustom yang diterapkan ke parameter tertentu.

public:
[System::Runtime::CompilerServices::Extension]
 static System::Collections::Generic::IEnumerable<Attribute ^> ^ GetCustomAttributes(System::Reflection::ParameterInfo ^ element);
public static System.Collections.Generic.IEnumerable<Attribute> GetCustomAttributes (this System.Reflection.ParameterInfo element);
static member GetCustomAttributes : System.Reflection.ParameterInfo -> seq<Attribute>
<Extension()>
Public Function GetCustomAttributes (element As ParameterInfo) As IEnumerable(Of Attribute)

Parameter

element
ParameterInfo

Parameter yang akan diperiksa.

Mengembalikan

Kumpulan atribut kustom yang diterapkan ke element, atau koleksi kosong jika tidak ada atribut tersebut.

Pengecualian

elementadalah null.

element bukan konstruktor, metode, properti, peristiwa, jenis, atau bidang.

Jenis atribut kustom tidak dapat dimuat.

Berlaku untuk

GetCustomAttributes(Module)

Sumber:
CustomAttributeExtensions.cs
Sumber:
CustomAttributeExtensions.cs
Sumber:
CustomAttributeExtensions.cs

Mengambil kumpulan atribut kustom yang diterapkan ke modul tertentu.

public:
[System::Runtime::CompilerServices::Extension]
 static System::Collections::Generic::IEnumerable<Attribute ^> ^ GetCustomAttributes(System::Reflection::Module ^ element);
public static System.Collections.Generic.IEnumerable<Attribute> GetCustomAttributes (this System.Reflection.Module element);
static member GetCustomAttributes : System.Reflection.Module -> seq<Attribute>
<Extension()>
Public Function GetCustomAttributes (element As Module) As IEnumerable(Of Attribute)

Parameter

element
Module

Modul yang akan diperiksa.

Mengembalikan

Kumpulan atribut kustom yang diterapkan ke element, atau koleksi kosong jika tidak ada atribut tersebut.

Pengecualian

elementadalah null.

Berlaku untuk

GetCustomAttributes(MemberInfo)

Sumber:
CustomAttributeExtensions.cs
Sumber:
CustomAttributeExtensions.cs
Sumber:
CustomAttributeExtensions.cs

Mengambil kumpulan atribut kustom yang diterapkan ke anggota tertentu.

public:
[System::Runtime::CompilerServices::Extension]
 static System::Collections::Generic::IEnumerable<Attribute ^> ^ GetCustomAttributes(System::Reflection::MemberInfo ^ element);
public static System.Collections.Generic.IEnumerable<Attribute> GetCustomAttributes (this System.Reflection.MemberInfo element);
static member GetCustomAttributes : System.Reflection.MemberInfo -> seq<Attribute>
<Extension()>
Public Function GetCustomAttributes (element As MemberInfo) As IEnumerable(Of Attribute)

Parameter

element
MemberInfo

Anggota yang akan diperiksa.

Mengembalikan

Kumpulan atribut kustom yang diterapkan ke element, atau koleksi kosong jika tidak ada atribut tersebut.

Pengecualian

elementadalah null.

element bukan konstruktor, metode, properti, peristiwa, jenis, atau bidang.

Jenis atribut kustom tidak dapat dimuat.

Berlaku untuk

GetCustomAttributes(Assembly)

Sumber:
CustomAttributeExtensions.cs
Sumber:
CustomAttributeExtensions.cs
Sumber:
CustomAttributeExtensions.cs

Mengambil kumpulan atribut kustom yang diterapkan ke rakitan tertentu.

public:
[System::Runtime::CompilerServices::Extension]
 static System::Collections::Generic::IEnumerable<Attribute ^> ^ GetCustomAttributes(System::Reflection::Assembly ^ element);
public static System.Collections.Generic.IEnumerable<Attribute> GetCustomAttributes (this System.Reflection.Assembly element);
static member GetCustomAttributes : System.Reflection.Assembly -> seq<Attribute>
<Extension()>
Public Function GetCustomAttributes (element As Assembly) As IEnumerable(Of Attribute)

Parameter

element
Assembly

Perakitan untuk diperiksa.

Mengembalikan

Kumpulan atribut kustom yang diterapkan ke element, atau koleksi kosong jika tidak ada atribut tersebut.

Pengecualian

elementadalah null.

Berlaku untuk

GetCustomAttributes<T>(ParameterInfo, Boolean)

Sumber:
CustomAttributeExtensions.cs
Sumber:
CustomAttributeExtensions.cs
Sumber:
CustomAttributeExtensions.cs

Mengambil kumpulan atribut kustom dari jenis tertentu yang diterapkan ke parameter tertentu, dan secara opsional memeriksa leluhur parameter tersebut.

public:
generic <typename T>
 where T : Attribute[System::Runtime::CompilerServices::Extension]
 static System::Collections::Generic::IEnumerable<T> ^ GetCustomAttributes(System::Reflection::ParameterInfo ^ element, bool inherit);
public static System.Collections.Generic.IEnumerable<T> GetCustomAttributes<T> (this System.Reflection.ParameterInfo element, bool inherit) where T : Attribute;
static member GetCustomAttributes : System.Reflection.ParameterInfo * bool -> seq<'T (requires 'T :> Attribute)> (requires 'T :> Attribute)
<Extension()>
Public Function GetCustomAttributes(Of T As Attribute) (element As ParameterInfo, inherit As Boolean) As IEnumerable(Of T)

Jenis parameter

T

Jenis atribut yang akan dicari.

Parameter

element
ParameterInfo

Parameter yang akan diperiksa.

inherit
Boolean

true untuk memeriksa leluhur element; jika tidak, false.

Mengembalikan

Kumpulan atribut kustom yang diterapkan ke dan yang cocok Tdengan element , atau koleksi kosong jika tidak ada atribut tersebut.

Pengecualian

elementadalah null.

element bukan konstruktor, metode, properti, peristiwa, jenis, atau bidang.

Jenis atribut kustom tidak dapat dimuat.

Berlaku untuk

GetCustomAttributes<T>(MemberInfo, Boolean)

Sumber:
CustomAttributeExtensions.cs
Sumber:
CustomAttributeExtensions.cs
Sumber:
CustomAttributeExtensions.cs

Mengambil kumpulan atribut kustom dari jenis tertentu yang diterapkan ke anggota tertentu, dan secara opsional memeriksa leluhur anggota tersebut.

public:
generic <typename T>
 where T : Attribute[System::Runtime::CompilerServices::Extension]
 static System::Collections::Generic::IEnumerable<T> ^ GetCustomAttributes(System::Reflection::MemberInfo ^ element, bool inherit);
public static System.Collections.Generic.IEnumerable<T> GetCustomAttributes<T> (this System.Reflection.MemberInfo element, bool inherit) where T : Attribute;
static member GetCustomAttributes : System.Reflection.MemberInfo * bool -> seq<'T (requires 'T :> Attribute)> (requires 'T :> Attribute)
<Extension()>
Public Function GetCustomAttributes(Of T As Attribute) (element As MemberInfo, inherit As Boolean) As IEnumerable(Of T)

Jenis parameter

T

Jenis atribut yang akan dicari.

Parameter

element
MemberInfo

Anggota yang akan diperiksa.

inherit
Boolean

true untuk memeriksa leluhur element; jika tidak, false.

Mengembalikan

Kumpulan atribut kustom yang diterapkan ke dan yang cocok Tdengan element , atau koleksi kosong jika tidak ada atribut tersebut.

Pengecualian

elementadalah null.

element bukan konstruktor, metode, properti, peristiwa, jenis, atau bidang.

Jenis atribut kustom tidak dapat dimuat.

Berlaku untuk

GetCustomAttributes<T>(ParameterInfo)

Sumber:
CustomAttributeExtensions.cs
Sumber:
CustomAttributeExtensions.cs
Sumber:
CustomAttributeExtensions.cs

Mengambil kumpulan atribut kustom dari jenis tertentu yang diterapkan ke parameter tertentu.

public:
generic <typename T>
 where T : Attribute[System::Runtime::CompilerServices::Extension]
 static System::Collections::Generic::IEnumerable<T> ^ GetCustomAttributes(System::Reflection::ParameterInfo ^ element);
public static System.Collections.Generic.IEnumerable<T> GetCustomAttributes<T> (this System.Reflection.ParameterInfo element) where T : Attribute;
static member GetCustomAttributes : System.Reflection.ParameterInfo -> seq<'T (requires 'T :> Attribute)> (requires 'T :> Attribute)
<Extension()>
Public Function GetCustomAttributes(Of T As Attribute) (element As ParameterInfo) As IEnumerable(Of T)

Jenis parameter

T

Jenis atribut yang akan dicari.

Parameter

element
ParameterInfo

Parameter yang akan diperiksa.

Mengembalikan

Kumpulan atribut kustom yang diterapkan ke dan yang cocok Tdengan element , atau koleksi kosong jika tidak ada atribut tersebut.

Pengecualian

elementadalah null.

element bukan konstruktor, metode, properti, peristiwa, jenis, atau bidang.

Jenis atribut kustom tidak dapat dimuat.

Berlaku untuk

GetCustomAttributes<T>(MemberInfo)

Sumber:
CustomAttributeExtensions.cs
Sumber:
CustomAttributeExtensions.cs
Sumber:
CustomAttributeExtensions.cs

Mengambil kumpulan atribut kustom dari jenis tertentu yang diterapkan ke anggota tertentu.

public:
generic <typename T>
 where T : Attribute[System::Runtime::CompilerServices::Extension]
 static System::Collections::Generic::IEnumerable<T> ^ GetCustomAttributes(System::Reflection::MemberInfo ^ element);
public static System.Collections.Generic.IEnumerable<T> GetCustomAttributes<T> (this System.Reflection.MemberInfo element) where T : Attribute;
static member GetCustomAttributes : System.Reflection.MemberInfo -> seq<'T (requires 'T :> Attribute)> (requires 'T :> Attribute)
<Extension()>
Public Function GetCustomAttributes(Of T As Attribute) (element As MemberInfo) As IEnumerable(Of T)

Jenis parameter

T

Jenis atribut yang akan dicari.

Parameter

element
MemberInfo

Anggota yang akan diperiksa.

Mengembalikan

Kumpulan atribut kustom yang diterapkan ke dan yang cocok Tdengan element , atau koleksi kosong jika tidak ada atribut tersebut.

Pengecualian

elementadalah null.

element bukan konstruktor, metode, properti, peristiwa, jenis, atau bidang.

Jenis atribut kustom tidak dapat dimuat.

Berlaku untuk

GetCustomAttributes<T>(Assembly)

Sumber:
CustomAttributeExtensions.cs
Sumber:
CustomAttributeExtensions.cs
Sumber:
CustomAttributeExtensions.cs

Mengambil kumpulan atribut kustom dari jenis tertentu yang diterapkan ke rakitan tertentu.

public:
generic <typename T>
 where T : Attribute[System::Runtime::CompilerServices::Extension]
 static System::Collections::Generic::IEnumerable<T> ^ GetCustomAttributes(System::Reflection::Assembly ^ element);
public static System.Collections.Generic.IEnumerable<T> GetCustomAttributes<T> (this System.Reflection.Assembly element) where T : Attribute;
static member GetCustomAttributes : System.Reflection.Assembly -> seq<'T (requires 'T :> Attribute)> (requires 'T :> Attribute)
<Extension()>
Public Function GetCustomAttributes(Of T As Attribute) (element As Assembly) As IEnumerable(Of T)

Jenis parameter

T

Jenis atribut yang akan dicari.

Parameter

element
Assembly

Perakitan untuk diperiksa.

Mengembalikan

Kumpulan atribut kustom yang diterapkan ke dan yang cocok Tdengan element , atau koleksi kosong jika tidak ada atribut tersebut.

Pengecualian

elementadalah null.

Berlaku untuk

GetCustomAttributes<T>(Module)

Sumber:
CustomAttributeExtensions.cs
Sumber:
CustomAttributeExtensions.cs
Sumber:
CustomAttributeExtensions.cs

Mengambil kumpulan atribut kustom dari jenis tertentu yang diterapkan ke modul tertentu.

public:
generic <typename T>
 where T : Attribute[System::Runtime::CompilerServices::Extension]
 static System::Collections::Generic::IEnumerable<T> ^ GetCustomAttributes(System::Reflection::Module ^ element);
public static System.Collections.Generic.IEnumerable<T> GetCustomAttributes<T> (this System.Reflection.Module element) where T : Attribute;
static member GetCustomAttributes : System.Reflection.Module -> seq<'T (requires 'T :> Attribute)> (requires 'T :> Attribute)
<Extension()>
Public Function GetCustomAttributes(Of T As Attribute) (element As Module) As IEnumerable(Of T)

Jenis parameter

T

Jenis atribut yang akan dicari.

Parameter

element
Module

Modul yang akan diperiksa.

Mengembalikan

Kumpulan atribut kustom yang diterapkan ke dan yang cocok Tdengan element , atau koleksi kosong jika tidak ada atribut tersebut.

Pengecualian

elementadalah null.

Berlaku untuk