1848 types derived from Attribute
ApiExplorerWebSite (3)
ApplicationModelWebSite (9)
Aspire.Azure.AI.OpenAI (2)
Aspire.Azure.Data.Tables (2)
Aspire.Azure.Messaging.EventHubs (2)
Aspire.Azure.Messaging.ServiceBus (2)
Aspire.Azure.Messaging.WebPubSub (2)
Aspire.Azure.Search.Documents (2)
Aspire.Azure.Security.KeyVault (2)
Aspire.Azure.Storage.Blobs (2)
Aspire.Azure.Storage.Queues (2)
Aspire.Components.Common.Tests (2)
Aspire.Dashboard.Components.Tests (1)
Aspire.Dashboard.Tests (1)
Aspire.Elastic.Clients.Elasticsearch (2)
Aspire.Hosting (2)
Aspire.Hosting.Analyzers (11)
Aspire.Hosting.Testing.Tests (1)
Aspire.Hosting.Tests (1)
Aspire.Microsoft.Azure.Cosmos (2)
Aspire.Microsoft.Data.SqlClient (2)
Aspire.Microsoft.EntityFrameworkCore.Cosmos (2)
Aspire.Microsoft.EntityFrameworkCore.SqlServer (2)
Aspire.Milvus.Client (2)
Aspire.MongoDB.Driver (2)
Aspire.MySqlConnector (2)
Aspire.NATS.Net (2)
Aspire.Npgsql (2)
Aspire.Npgsql.EntityFrameworkCore.PostgreSQL (2)
Aspire.OpenAI (2)
Aspire.Oracle.EntityFrameworkCore (2)
Aspire.Playground.Tests (3)
Aspire.Pomelo.EntityFrameworkCore.MySql (2)
Aspire.Qdrant.Client (2)
Aspire.RabbitMQ.Client (2)
Aspire.Seq (2)
Aspire.StackExchange.Redis (2)
Aspire.StackExchange.Redis.DistributedCaching (2)
Aspire.StackExchange.Redis.OutputCaching (2)
BasicTestApp (1)
BasicWebSite (3)
ConfigurationSchemaGenerator.Tests (2)
CorsWebSite (1)
dotnet-openapi (1)
dotnet-svcutil-lib (64)
IIS.FunctionalTests (9)
IIS.LongTests (7)
IIS.Microbenchmarks (1)
IIS.NewHandler.FunctionalTests (7)
IIS.NewShim.FunctionalTests (7)
IIS.ShadowCopy.Tests (7)
IIS.Tests (1)
IISExpress.FunctionalTests (7)
illink (3)
ILLink.RoslynAnalyzer (12)
Infrastructure.Common (2)
InMemory.FunctionalTests (2)
Interop.FunctionalTests (3)
Microsoft.AspNetCore.Analyzers (11)
Microsoft.AspNetCore.App.Analyzers (11)
Microsoft.AspNetCore.App.Analyzers.Test (1)
Microsoft.AspNetCore.App.SourceGenerators (11)
Microsoft.AspNetCore.App.UnitTests (1)
Microsoft.AspNetCore.Authorization (14)
Microsoft.AspNetCore.Authorization.Test (1)
Microsoft.AspNetCore.Components (12)
Microsoft.AspNetCore.Components.Analyzers (11)
Microsoft.AspNetCore.Components.Endpoints (1)
Microsoft.AspNetCore.Components.Performance (1)
Microsoft.AspNetCore.Components.Server (1)
Microsoft.AspNetCore.Components.Web (1)
Microsoft.AspNetCore.ConcurrencyLimiter.Microbenchmarks (1)
Microsoft.AspNetCore.Cors (2)
Microsoft.AspNetCore.Cryptography.Internal (11)
Microsoft.AspNetCore.Cryptography.Internal.Tests (2)
Microsoft.AspNetCore.Cryptography.KeyDerivation (1)
Microsoft.AspNetCore.Cryptography.KeyDerivation.Tests (2)
Microsoft.AspNetCore.DataProtection (8)
Microsoft.AspNetCore.DataProtection.Abstractions (17)
Microsoft.AspNetCore.DataProtection.Extensions (17)
Microsoft.AspNetCore.DataProtection.Extensions.Tests (3)
Microsoft.AspNetCore.DataProtection.StackExchangeRedis (12)
Microsoft.AspNetCore.DataProtection.Tests (5)
Microsoft.AspNetCore.Grpc.Microbenchmarks (1)
Microsoft.AspNetCore.Hosting.Abstractions (1)
Microsoft.AspNetCore.Http (2)
Microsoft.AspNetCore.Http.Abstractions (1)
Microsoft.AspNetCore.Http.Abstractions.Microbenchmarks (1)
Microsoft.AspNetCore.Http.Extensions (4)
Microsoft.AspNetCore.Http.Extensions.Tests (13)
Microsoft.AspNetCore.Http.Microbenchmarks (4)
Microsoft.AspNetCore.Http.RequestDelegateGenerator (11)
Microsoft.AspNetCore.HttpLogging (1)
Microsoft.AspNetCore.Identity (3)
Microsoft.AspNetCore.Identity.EntityFrameworkCore.Test (1)
Microsoft.AspNetCore.Identity.InMemory.Test (1)
Microsoft.AspNetCore.Identity.Test (1)
Microsoft.AspNetCore.Identity.UI (2)
Microsoft.AspNetCore.InternalTesting (31)
Microsoft.AspNetCore.Metadata (11)
Microsoft.AspNetCore.Mvc.Analyzers (11)
Microsoft.AspNetCore.Mvc.Api.Analyzers (11)
Microsoft.AspNetCore.Mvc.ApiExplorer.Test (2)
Microsoft.AspNetCore.Mvc.Core (53)
Microsoft.AspNetCore.Mvc.Core.Test (29)
Microsoft.AspNetCore.Mvc.Cors.Test (1)
Microsoft.AspNetCore.Mvc.DataAnnotations (2)
Microsoft.AspNetCore.Mvc.DataAnnotations.Test (4)
Microsoft.AspNetCore.Mvc.IntegrationTests (3)
Microsoft.AspNetCore.Mvc.Razor (2)
Microsoft.AspNetCore.Mvc.RazorPages (3)
Microsoft.AspNetCore.Mvc.Testing (1)
Microsoft.AspNetCore.Mvc.Testing.Tasks (11)
Microsoft.AspNetCore.Mvc.ViewFeatures (11)
Microsoft.AspNetCore.OpenApi.Microbenchmarks (1)
Microsoft.AspNetCore.OutputCaching (1)
Microsoft.AspNetCore.OutputCaching.Microbenchmarks (1)
Microsoft.AspNetCore.RateLimiting (2)
Microsoft.AspNetCore.Razor (5)
Microsoft.AspNetCore.Razor.Runtime (6)
Microsoft.AspNetCore.RequestDecompression.Microbenchmarks (1)
Microsoft.AspNetCore.ResponseCaching.Microbenchmarks (1)
Microsoft.AspNetCore.ResponseCompression.Microbenchmarks (1)
Microsoft.AspNetCore.Routing (4)
Microsoft.AspNetCore.Routing.Microbenchmarks (1)
Microsoft.AspNetCore.Routing.Tests (8)
Microsoft.AspNetCore.Security.Microbenchmarks (1)
Microsoft.AspNetCore.Server.HttpSys.FunctionalTests (3)
Microsoft.AspNetCore.Server.HttpSys.Microbenchmarks (1)
Microsoft.AspNetCore.Server.HttpSys.NonHelixTests (1)
Microsoft.AspNetCore.Server.IntegrationTesting (3)
Microsoft.AspNetCore.Server.Kestrel.Microbenchmarks (1)
Microsoft.AspNetCore.Server.Kestrel.Transport.Quic.Tests (2)
Microsoft.AspNetCore.Shared.Tests (2)
Microsoft.AspNetCore.SignalR.Client.SourceGenerator (11)
Microsoft.AspNetCore.SignalR.Client.Tests (2)
Microsoft.AspNetCore.SignalR.Core (1)
Microsoft.AspNetCore.SignalR.Microbenchmarks (1)
Microsoft.AspNetCore.SignalR.StackExchangeRedis.Tests (1)
Microsoft.AspNetCore.SignalR.Tests (2)
Microsoft.AspNetCore.SignalR.Tests.Utils (1)
Microsoft.AspNetCore.WebSockets.ConformanceTests (1)
Microsoft.AspNetCore.WebSockets.Microbenchmarks (1)
Microsoft.AspNetCore.WebUtilities.Microbenchmarks (1)
Microsoft.Bcl.AsyncInterfaces (3)
Microsoft.Bcl.Numerics (3)
Microsoft.Build.Framework (21)
Microsoft.Build.Tasks.CodeAnalysis (1)
Microsoft.Build.Tasks.CodeAnalysis.UnitTests (1)
Microsoft.CodeAnalysis (9)
Microsoft.CodeAnalysis.CodeStyle (10)
Microsoft.CodeAnalysis.CodeStyle.UnitTestUtilities (1)
Microsoft.CodeAnalysis.CSharp.ExpressionEvaluator.ResultProvider (1)
Microsoft.CodeAnalysis.ExpressionEvaluator.ResultProvider (2)
Microsoft.CodeAnalysis.ExpressionEvaluator.ResultProvider.Utilities (4)
Microsoft.CodeAnalysis.InteractiveHost (4)
Microsoft.CodeAnalysis.LanguageServer.Protocol (2)
Microsoft.CodeAnalysis.PooledObjects.Package (1)
Microsoft.CodeAnalysis.Test.Utilities (3)
Microsoft.CodeAnalysis.UnitTests (2)
Microsoft.CodeAnalysis.Workspaces (11)
Microsoft.CodeAnalysis.Workspaces.MSBuild.BuildHost (9)
Microsoft.CommonLanguageServerProtocol.Framework.Package (1)
Microsoft.DotNet.SwaggerGenerator.CodeGenerator (2)
Microsoft.DotNet.XUnitExtensions (10)
Microsoft.Extensions.Caching.MicroBenchmarks (11)
Microsoft.Extensions.Caching.StackExchangeRedis (12)
Microsoft.Extensions.Compliance.Abstractions (1)
Microsoft.Extensions.Configuration.Abstractions (1)
Microsoft.Extensions.Configuration.UserSecrets (1)
Microsoft.Extensions.DependencyInjection.Abstractions (3)
Microsoft.Extensions.Diagnostics.HealthChecks (17)
Microsoft.Extensions.Diagnostics.HealthChecks.Abstractions (12)
Microsoft.Extensions.Diagnostics.Probes (19)
Microsoft.Extensions.Diagnostics.ResourceMonitoring (20)
Microsoft.Extensions.Diagnostics.Testing (19)
Microsoft.Extensions.FileProviders.Embedded (17)
Microsoft.Extensions.Hosting.Testing (19)
Microsoft.Extensions.Http.Polly (11)
Microsoft.Extensions.Identity.Core (18)
Microsoft.Extensions.Identity.Stores (17)
Microsoft.Extensions.Localization (2)
Microsoft.Extensions.Localization.Abstractions (12)
Microsoft.Extensions.Localization.RootNamespace.Tests (11)
Microsoft.Extensions.Logging (1)
Microsoft.Extensions.Logging.Abstractions (1)
Microsoft.Extensions.Logging.Generators (11)
Microsoft.Extensions.ObjectPool.DependencyInjection (18)
Microsoft.Extensions.ObjectPool.Microbenchmark (1)
Microsoft.Extensions.Options (3)
Microsoft.Extensions.Options.Contextual (20)
Microsoft.Extensions.Options.SourceGeneration (11)
Microsoft.Extensions.Resilience (18)
Microsoft.Extensions.Telemetry (18)
Microsoft.Extensions.Telemetry.Abstractions (29)
Microsoft.Gen.ContextualOptions.Generated.Tests (1)
Microsoft.Interop.ComInterfaceGenerator (12)
Microsoft.Interop.JavaScript.JSImportGenerator (12)
Microsoft.Interop.LibraryImportGenerator (12)
Microsoft.Interop.LibraryImportGenerator.Downlevel (12)
Microsoft.Interop.SourceGeneration (15)
Microsoft.JSInterop (1)
Microsoft.Maui (3)
Microsoft.Maui.Controls (20)
Microsoft.Maui.Controls.SourceGen (1)
Microsoft.Maui.Controls.Xaml (2)
Microsoft.Maui.Graphics (2)
Microsoft.ML.Core (19)
Microsoft.ML.CpuMath (2)
Microsoft.ML.Data (9)
Microsoft.ML.DataView (1)
Microsoft.ML.PerformanceTests (1)
Microsoft.ML.TestFrameworkCommon (1)
Microsoft.ML.TorchSharp (1)
Microsoft.TestUtilities (1)
Microsoft.VisualBasic.Core (9)
Microsoft.Web.Xdt.Extensions (1)
MSBuildTaskHost (16)
Mvc.Api.Analyzers.Test (1)
Mvc.RoutingWebSite (2)
PresentationCore (3)
PresentationFramework (10)
RazorPagesWebSite (8)
Replay (3)
RoutingSandbox (2)
Shared (19)
Sockets.BindTests (5)
Sockets.FunctionalTests (5)
System.Collections.Immutable (1)
System.ComponentModel.Annotations (20)
System.ComponentModel.Composition (11)
System.ComponentModel.Primitives (18)
System.ComponentModel.TypeConverter (28)
System.Composition.AttributedModel (11)
System.Configuration.ConfigurationManager (13)
System.Data.Common (1)
System.Diagnostics.TraceSource (2)
System.DirectoryServices.AccountManagement (3)
System.Drawing.Common (18)
System.Linq.Expressions (1)
System.Net.Quic (1)
System.ObjectModel (3)
System.Private.CoreLib (221)
src\libraries\System.Private.CoreLib\src\System\Diagnostics\Tracing\TraceLogging\EventDataAttribute.cs (1)
18: Attribute
src\libraries\System.Private.CoreLib\src\System\Diagnostics\Tracing\TraceLogging\EventFieldAttribute.cs (1)
36: Attribute
src\libraries\System.Private.CoreLib\src\System\Diagnostics\Tracing\TraceLogging\EventIgnoreAttribute.cs (1)
15: Attribute
System.Private.CoreLib.Generators (11)
System.Private.Windows.Core.TestUtilities (1)
System.Private.Xml (23)
System.Runtime.CompilerServices.VisualC (7)
System.Runtime.InteropServices (18)
System.Runtime.InteropServices.JavaScript (3)
System.Runtime.Serialization.Primitives (7)
System.ServiceModel.Primitives.Tests (2)
System.Text.Json (2)
System.Text.Json.SourceGeneration (15)
System.Text.RegularExpressions (1)
System.Text.RegularExpressions.Generator (11)
System.Windows.Forms (7)
System.Windows.Forms.Design (1)
System.Windows.Forms.Tests (3)
System.Xaml (23)
UnitTests.Common (1)
VersioningWebSite (1)
Xunit.NetCore.Extensions (1)
1 instantiation of Attribute
System.Runtime.InteropServices (1)
900 references to Attribute
Aspire.Dashboard.Tests (2)
ConfigurationSchemaGenerator.Tests (2)
dotnet-svcutil-lib (23)
FrameworkFork\System.ServiceModel\System\ServiceModel\Channels\SecurityAttributeGenerationHelper.cs (1)
13where T : Attribute
illink (13)
Microsoft.AspNetCore.Antiforgery (1)
Microsoft.AspNetCore.Components (1)
Microsoft.AspNetCore.Http.Extensions (1)
Microsoft.AspNetCore.Identity.EntityFrameworkCore (4)
Microsoft.AspNetCore.Identity.UI (2)
Microsoft.AspNetCore.Mvc.ApiExplorer (3)
Microsoft.AspNetCore.Mvc.Core (6)
Microsoft.AspNetCore.Mvc.Core.Test (8)
Microsoft.AspNetCore.Mvc.DataAnnotations (1)
Microsoft.AspNetCore.Mvc.DataAnnotations.Test (27)
Microsoft.AspNetCore.OpenApi (5)
Microsoft.AspNetCore.OpenApi.Tests (1)
Microsoft.AspNetCore.Routing (2)
Microsoft.AspNetCore.Routing.FunctionalTests (1)
Microsoft.AspNetCore.Shared.Tests (1)
Microsoft.Build.BuildCheck.UnitTests (1)
Microsoft.Build.UnitTests.Shared (1)
Microsoft.CodeAnalysis (1)
Microsoft.CodeAnalysis.CodeStyle (2)
Microsoft.CodeAnalysis.CSharp (2)
Microsoft.CodeAnalysis.Features (4)
Microsoft.CodeAnalysis.LanguageServer.Protocol (1)
Microsoft.CodeAnalysis.VisualBasic (1)
Microsoft.CodeAnalysis.Workspaces (3)
Microsoft.CommonLanguageServerProtocol.Framework.Package (1)
Microsoft.CSharp (1)
Microsoft.DotNet.Build.Tasks.Feed (1)
Microsoft.Extensions.DependencyInjection.Abstractions (3)
Microsoft.Gen.Logging.Generated.Tests (1)
Microsoft.Maui.Controls.DesignTools (2)
Microsoft.Maui.Controls.Xaml.DesignTools (1)
Microsoft.ML.Benchmarks.Tests (1)
Microsoft.ML.Core (1)
Microsoft.ML.Core.Tests (3)
Microsoft.ML.Data (12)
Microsoft.ML.DataView (2)
Microsoft.VisualBasic.Tests (1)
mscorlib (1)
netstandard (1)
PresentationCore (4)
PresentationFramework (22)
ReachFramework (9)
System.ComponentModel.Annotations (19)
System.ComponentModel.Composition (3)
System.ComponentModel.Composition.Registration (37)
System\ComponentModel\Composition\Registration\PartBuilder.cs (14)
13private static readonly List<Attribute> s_importingConstructorList = new List<Attribute>() { new ImportingConstructorAttribute() };
231foreach (Attribute attr in member.GetCustomAttributes(typeof(Attribute), false))
250internal IEnumerable<Attribute> BuildTypeAttributes(Type type)
252var attributes = new List<Attribute>();
362internal bool BuildConstructorAttributes(Type type, ref List<Tuple<object, List<Attribute>>> configuredMembers)
403internal static void BuildDefaultConstructorAttributes(Type type, ref List<Tuple<object, List<Attribute>>> configuredMembers)
413private static void ConfigureConstructorAttributes(ConstructorInfo constructorInfo, ref List<Tuple<object, List<Attribute>>> configuredMembers, Action<ParameterInfo, ImportBuilder> configureConstructorImports)
415configuredMembers ??= new List<Tuple<object, List<Attribute>>>();
437List<Attribute> attributes = null;
444internal void BuildPropertyAttributes(Type type, ref List<Tuple<object, List<Attribute>>> configuredMembers)
450List<Attribute> attributes = null;
530configuredMembers ??= new List<Tuple<object, List<Attribute>>>();
System.ComponentModel.TypeConverter (172)
System\ComponentModel\TypeConverter.cs (4)
239return GetProperties(context, value, new Attribute[] { BrowsableAttribute.Yes });
249public virtual PropertyDescriptorCollection? GetProperties(ITypeDescriptorContext? context, object value, Attribute[]? attributes)
349protected SimplePropertyDescriptor(Type componentType, string name, Type propertyType) : this(componentType, name, propertyType, Array.Empty<Attribute>())
356protected SimplePropertyDescriptor(Type componentType, string name, Type propertyType, Attribute[]? attributes) : base(name, attributes)
System\ComponentModel\TypeDescriptor.cs (45)
190public static TypeDescriptionProvider AddAttributes(Type type, params Attribute[] attributes)
212public static TypeDescriptionProvider AddAttributes(object instance, params Attribute[] attributes)
455params Attribute[] attributes)
467params Attribute[] attributes)
515params Attribute[] attributes)
528params Attribute[] attributes)
561private static ArrayList? FilterMembers(IList members, Attribute[] attributes)
776Attribute[] attrArray = new Attribute[results.Count];
1119Attribute[] attributes)
1167public static EventDescriptorCollection GetEvents(object component, Attribute[] attributes)
1178public static EventDescriptorCollection GetEvents(object component, Attribute[]? attributes, bool noCustomTypeDesc)
1356Attribute[]? attributes)
1413public static PropertyDescriptorCollection GetProperties(object component, Attribute[]? attributes)
1424public static PropertyDescriptorCollection GetProperties(object component, Attribute[]? attributes, bool noCustomTypeDesc)
1435private static PropertyDescriptorCollection GetPropertiesImpl(object component, Attribute[]? attributes, bool noCustomTypeDesc, bool noAttributes)
1874private static ICollection PipelineAttributeFilter(int pipelineType, ICollection members, Attribute[]? filter, IDictionary? cache)
1993foreach (Attribute attr in members)
2088Attribute[] attrArray = new Attribute[list.Count];
2095throw new ArgumentException(SR.Format(SR.TypeDescriptorExpectedElementType, typeof(Attribute).FullName));
2250Attribute[] attrArray = new Attribute[list.Count];
2727private static bool ShouldHideMember(MemberDescriptor? member, Attribute? attribute)
2734Attribute? memberAttribute = member.Attributes[attribute.GetType()];
2848EventDescriptorCollection ICustomTypeDescriptor.GetEvents(Attribute[]? attributes)
2860PropertyDescriptorCollection ICustomTypeDescriptor.GetProperties(Attribute[]? attributes)
2876private readonly Attribute[] _attrs;
2881internal AttributeProvider(TypeDescriptionProvider existingProvider, params Attribute[] attrs) : base(existingProvider)
2899private readonly Attribute[] _attributeArray;
2905internal AttributeTypeDescriptor(Attribute[] attrs, ICustomTypeDescriptor? parent) : base(parent)
2918Attribute[]? finalAttr;
2920Attribute[] newAttrs = _attributeArray;
2921Attribute[] newArray = new Attribute[existing.Count + newAttrs.Length];
2951finalAttr = new Attribute[actualCount];
2971private readonly Attribute[] _filter;
2974internal AttributeFilterCacheItem(Attribute[] filter, ICollection filteredMembers)
2980internal bool IsValid(Attribute[] filter)
3175EventDescriptorCollection ICustomTypeDescriptor.GetEvents(Attribute[]? attributes)
3199PropertyDescriptorCollection ICustomTypeDescriptor.GetProperties(Attribute[]? attributes)
3650EventDescriptorCollection ICustomTypeDescriptor.GetEvents(Attribute[]? attributes)
3720PropertyDescriptorCollection ICustomTypeDescriptor.GetProperties(Attribute[]? attributes)
4061public EventDescriptorCollection GetEvents(Attribute[]? attributes)
4147public PropertyDescriptorCollection GetProperties(Attribute[]? attributes)
System.Composition.AttributedModel (2)
System.Composition.Convention (50)
System\Composition\Convention\ConventionBuilder.cs (25)
19private readonly Dictionary<MemberInfo, List<Attribute>> _memberInfos = new Dictionary<MemberInfo, List<Attribute>>();
20private readonly Dictionary<ParameterInfo, List<Attribute>> _parameters = new Dictionary<ParameterInfo, List<Attribute>>();
126private List<Tuple<object, List<Attribute>>> EvaluateThisTypeInfoAgainstTheConvention(TypeInfo typeInfo)
128List<Attribute> attributes = new List<Attribute>();
129var configuredMembers = new List<Tuple<object, List<Attribute>>>();
159public override IEnumerable<Attribute> GetCustomAttributes(Type reflectedType, System.Reflection.MemberInfo member)
167List<Attribute> cachedAttributes = null;
189List<Attribute> attributeList;
190foreach (Tuple<object, List<Attribute>> element in EvaluateThisTypeInfoAgainstTheConvention(typeInfo))
200if (!_memberInfos.TryGetValue(mi, out List<Attribute> memberAttributes))
215if (!_parameters.TryGetValue(pi, out List<Attribute> parameterAttributes))
238IEnumerable<Attribute> appliedAttributes;
240appliedAttributes = Enumerable.Empty<Attribute>();
242appliedAttributes = member.GetCustomAttributes<Attribute>(false);
247private List<Attribute> ReadMemberCustomAttributes(Type reflectedType, System.Reflection.MemberInfo member)
249List<Attribute> cachedAttributes = null;
299public override IEnumerable<Attribute> GetCustomAttributes(Type reflectedType, System.Reflection.ParameterInfo parameter)
306IEnumerable<Attribute> attributes = parameter.GetCustomAttributes<Attribute>(false);
307List<Attribute> cachedAttributes = ReadParameterCustomAttributes(reflectedType, parameter);
311private List<Attribute> ReadParameterCustomAttributes(Type reflectedType, System.Reflection.ParameterInfo parameter)
313List<Attribute> cachedAttributes = null;
System\Composition\Convention\PartConventionBuilder.cs (20)
17private static List<Attribute> s_onImportsSatisfiedAttributeList;
18private static readonly List<Attribute> s_importingConstructorList = new List<Attribute>() { new ImportingConstructorAttribute() };
470foreach (Attribute attr in member.GetCustomAttributes<Attribute>(false))
489internal IEnumerable<Attribute> BuildTypeAttributes(Type type)
491var attributes = new List<Attribute>();
598internal bool BuildConstructorAttributes(Type type, ref List<Tuple<object, List<Attribute>>> configuredMembers)
606Attribute[] attributes = Attribute.GetCustomAttributes(ci, typeof(ImportingConstructorAttribute), false);
636internal static void BuildDefaultConstructorAttributes(Type type, ref List<Tuple<object, List<Attribute>>> configuredMembers)
646private static void ConfigureConstructorAttributes(ConstructorInfo constructorInfo, ref List<Tuple<object, List<Attribute>>> configuredMembers, Action<ParameterInfo, ImportConventionBuilder> configureConstructorImports)
648configuredMembers ??= new List<Tuple<object, List<Attribute>>>();
670List<Attribute> attributes = null;
677internal void BuildOnImportsSatisfiedNotification(Type type, ref List<Tuple<object, List<Attribute>>> configuredMembers)
715var onImportsSatisfiedAttributeList = new List<Attribute>
721configuredMembers.Add(new Tuple<object, List<Attribute>>(mi, s_onImportsSatisfiedAttributeList));
731internal void BuildPropertyAttributes(Type type, ref List<Tuple<object, List<Attribute>>> configuredMembers)
737List<Attribute> attributes = null;
817configuredMembers ??= new List<Tuple<object, List<Attribute>>>();
System.Composition.TypedParts (15)
System\Composition\Convention\AttributedModelProviderExtensions.cs (7)
14public static TAttribute GetDeclaredAttribute<TAttribute>(this AttributedModelProvider convention, Type reflectedType, MemberInfo member) where TAttribute : Attribute
19public static Attribute[] GetDeclaredAttributes(this AttributedModelProvider convention, Type reflectedType, MemberInfo member)
24public static TAttribute[] GetDeclaredAttributes<TAttribute>(this AttributedModelProvider convention, Type reflectedType, MemberInfo member) where TAttribute : Attribute
29public static TAttribute GetDeclaredAttribute<TAttribute>(this AttributedModelProvider convention, Type reflectedType, ParameterInfo parameter) where TAttribute : Attribute
34public static Attribute[] GetDeclaredAttributes(this AttributedModelProvider convention, Type reflectedType, ParameterInfo parameter)
36return convention.GetCustomAttributes(reflectedType, parameter).OfType<Attribute>().ToArray();
39public static TAttribute[] GetDeclaredAttributes<TAttribute>(this AttributedModelProvider convention, Type reflectedType, ParameterInfo parameter) where TAttribute : Attribute
System.Configuration.ConfigurationManager (12)
System.Data.Common (23)
System.Drawing.Common (2)
System.Private.CoreLib (165)
src\libraries\System.Private.CoreLib\src\System\Reflection\CustomAttributeExtensions.cs (54)
11public static Attribute? GetCustomAttribute(this Assembly element, Type attributeType)
13return Attribute.GetCustomAttribute(element, attributeType);
15public static Attribute? GetCustomAttribute(this Module element, Type attributeType)
17return Attribute.GetCustomAttribute(element, attributeType);
19public static Attribute? GetCustomAttribute(this MemberInfo element, Type attributeType)
21return Attribute.GetCustomAttribute(element, attributeType);
23public static Attribute? GetCustomAttribute(this ParameterInfo element, Type attributeType)
25return Attribute.GetCustomAttribute(element, attributeType);
28public static T? GetCustomAttribute<T>(this Assembly element) where T : Attribute
32public static T? GetCustomAttribute<T>(this Module element) where T : Attribute
36public static T? GetCustomAttribute<T>(this MemberInfo element) where T : Attribute
40public static T? GetCustomAttribute<T>(this ParameterInfo element) where T : Attribute
45public static Attribute? GetCustomAttribute(this MemberInfo element, Type attributeType, bool inherit)
47return Attribute.GetCustomAttribute(element, attributeType, inherit);
49public static Attribute? GetCustomAttribute(this ParameterInfo element, Type attributeType, bool inherit)
51return Attribute.GetCustomAttribute(element, attributeType, inherit);
54public static T? GetCustomAttribute<T>(this MemberInfo element, bool inherit) where T : Attribute
58public static T? GetCustomAttribute<T>(this ParameterInfo element, bool inherit) where T : Attribute
65public static IEnumerable<Attribute> GetCustomAttributes(this Assembly element)
67return Attribute.GetCustomAttributes(element);
69public static IEnumerable<Attribute> GetCustomAttributes(this Module element)
71return Attribute.GetCustomAttributes(element);
73public static IEnumerable<Attribute> GetCustomAttributes(this MemberInfo element)
75return Attribute.GetCustomAttributes(element);
77public static IEnumerable<Attribute> GetCustomAttributes(this ParameterInfo element)
79return Attribute.GetCustomAttributes(element);
82public static IEnumerable<Attribute> GetCustomAttributes(this MemberInfo element, bool inherit)
84return Attribute.GetCustomAttributes(element, inherit);
86public static IEnumerable<Attribute> GetCustomAttributes(this ParameterInfo element, bool inherit)
88return Attribute.GetCustomAttributes(element, inherit);
93public static IEnumerable<Attribute> GetCustomAttributes(this Assembly element, Type attributeType)
95return Attribute.GetCustomAttributes(element, attributeType);
97public static IEnumerable<Attribute> GetCustomAttributes(this Module element, Type attributeType)
99return Attribute.GetCustomAttributes(element, attributeType);
101public static IEnumerable<Attribute> GetCustomAttributes(this MemberInfo element, Type attributeType)
103return Attribute.GetCustomAttributes(element, attributeType);
105public static IEnumerable<Attribute> GetCustomAttributes(this ParameterInfo element, Type attributeType)
107return Attribute.GetCustomAttributes(element, attributeType);
110public static IEnumerable<T> GetCustomAttributes<T>(this Assembly element) where T : Attribute
114public static IEnumerable<T> GetCustomAttributes<T>(this Module element) where T : Attribute
118public static IEnumerable<T> GetCustomAttributes<T>(this MemberInfo element) where T : Attribute
122public static IEnumerable<T> GetCustomAttributes<T>(this ParameterInfo element) where T : Attribute
127public static IEnumerable<Attribute> GetCustomAttributes(this MemberInfo element, Type attributeType, bool inherit)
129return Attribute.GetCustomAttributes(element, attributeType, inherit);
131public static IEnumerable<Attribute> GetCustomAttributes(this ParameterInfo element, Type attributeType, bool inherit)
133return Attribute.GetCustomAttributes(element, attributeType, inherit);
136public static IEnumerable<T> GetCustomAttributes<T>(this MemberInfo element, bool inherit) where T : Attribute
140public static IEnumerable<T> GetCustomAttributes<T>(this ParameterInfo element, bool inherit) where T : Attribute
149return Attribute.IsDefined(element, attributeType);
153return Attribute.IsDefined(element, attributeType);
157return Attribute.IsDefined(element, attributeType);
161return Attribute.IsDefined(element, attributeType);
166return Attribute.IsDefined(element, attributeType, inherit);
170return Attribute.IsDefined(element, attributeType, inherit);
src\System\Attribute.CoreCLR.cs (93)
16private static Attribute[] InternalGetCustomAttributes(PropertyInfo element, Type type, bool inherit)
20Debug.Assert(type.IsSubclassOf(typeof(Attribute)) || type == typeof(Attribute));
23Attribute[] attributes = (Attribute[])element.GetCustomAttributes(type, inherit);
38List<Attribute> attributeList = new List<Attribute>();
48Attribute[] array = CreateAttributeArrayHelper(type, attributeList.Count);
120private static Attribute[] InternalGetCustomAttributes(EventInfo element, Type type, bool inherit)
124Debug.Assert(type.IsSubclassOf(typeof(Attribute)) || type == typeof(Attribute));
127Attribute[] attributes = (Attribute[])element.GetCustomAttributes(type, inherit);
142List<Attribute> attributeList = new List<Attribute>();
152Attribute[] array = CreateAttributeArrayHelper(type, attributeList.Count);
237private static Attribute[] InternalParamGetCustomAttributes(ParameterInfo param, Type? type, bool inherit)
251type ??= typeof(Attribute);
264Attribute[] ret;
268ret = (Attribute[])objAttr;
299Attribute[] attributes = CreateAttributeArrayHelper(type, count);
306attributes[count] = (Attribute)attr;
311Attribute[] temp = ret;
354if ((objAttr[i] is Attribute) && (attribUsage.Inherited))
367private static void CopyToAttributeList(List<Attribute> attributeList, Attribute[] attributes, Dictionary<Type, AttributeUsageAttribute> types)
397private static void AddAttributesToList(List<Attribute> attributeList, Attribute[] attributes, Dictionary<Type, AttributeUsageAttribute> types)
436private static Attribute[] CreateAttributeArrayHelper(Type elementType, int elementCount) =>
437elementType.ContainsGenericParameters ? new Attribute[elementCount] : (Attribute[])Array.CreateInstance(elementType, elementCount);
445public static Attribute[] GetCustomAttributes(MemberInfo element, Type attributeType)
450public static Attribute[] GetCustomAttributes(MemberInfo element, Type attributeType, bool inherit)
455if (!attributeType.IsSubclassOf(typeof(Attribute)) && attributeType != typeof(Attribute))
462_ => (Attribute[])element.GetCustomAttributes(attributeType, inherit)
466public static Attribute[] GetCustomAttributes(MemberInfo element)
471public static Attribute[] GetCustomAttributes(MemberInfo element, bool inherit)
477MemberTypes.Property => InternalGetCustomAttributes((PropertyInfo)element, typeof(Attribute), inherit),
478MemberTypes.Event => InternalGetCustomAttributes((EventInfo)element, typeof(Attribute), inherit),
479_ => (Attribute[])element.GetCustomAttributes(typeof(Attribute), inherit)
494if (!attributeType.IsSubclassOf(typeof(Attribute)) && attributeType != typeof(Attribute))
505public static Attribute? GetCustomAttribute(MemberInfo element, Type attributeType)
510public static Attribute? GetCustomAttribute(MemberInfo element, Type attributeType, bool inherit)
512Attribute[] attrib = GetCustomAttributes(element, attributeType, inherit);
517Attribute match = attrib[0];
527public static Attribute[] GetCustomAttributes(ParameterInfo element)
532public static Attribute[] GetCustomAttributes(ParameterInfo element, Type attributeType)
537public static Attribute[] GetCustomAttributes(ParameterInfo element, Type attributeType, bool inherit)
542if (!attributeType.IsSubclassOf(typeof(Attribute)) && attributeType != typeof(Attribute))
552return (Attribute[])element.GetCustomAttributes(attributeType, inherit);
555public static Attribute[] GetCustomAttributes(ParameterInfo element, bool inherit)
566return (Attribute[])element.GetCustomAttributes(typeof(Attribute), inherit);
581if (!attributeType.IsSubclassOf(typeof(Attribute)) && attributeType != typeof(Attribute))
603public static Attribute? GetCustomAttribute(ParameterInfo element, Type attributeType)
608public static Attribute? GetCustomAttribute(ParameterInfo element, Type attributeType, bool inherit)
612Attribute[] attrib = GetCustomAttributes(element, attributeType, inherit);
617Attribute match = attrib[0];
627public static Attribute[] GetCustomAttributes(Module element, Type attributeType)
632public static Attribute[] GetCustomAttributes(Module element)
637public static Attribute[] GetCustomAttributes(Module element, bool inherit)
641return (Attribute[])element.GetCustomAttributes(typeof(Attribute), inherit);
644public static Attribute[] GetCustomAttributes(Module element, Type attributeType, bool inherit)
649if (!attributeType.IsSubclassOf(typeof(Attribute)) && attributeType != typeof(Attribute))
652return (Attribute[])element.GetCustomAttributes(attributeType, inherit);
667if (!attributeType.IsSubclassOf(typeof(Attribute)) && attributeType != typeof(Attribute))
673public static Attribute? GetCustomAttribute(Module element, Type attributeType)
678public static Attribute? GetCustomAttribute(Module element, Type attributeType, bool inherit)
682Attribute[] attrib = GetCustomAttributes(element, attributeType, inherit);
687Attribute match = attrib[0];
697public static Attribute[] GetCustomAttributes(Assembly element, Type attributeType)
702public static Attribute[] GetCustomAttributes(Assembly element, Type attributeType, bool inherit)
707if (!attributeType.IsSubclassOf(typeof(Attribute)) && attributeType != typeof(Attribute))
710return (Attribute[])element.GetCustomAttributes(attributeType, inherit);
713public static Attribute[] GetCustomAttributes(Assembly element)
718public static Attribute[] GetCustomAttributes(Assembly element, bool inherit)
722return (Attribute[])element.GetCustomAttributes(typeof(Attribute), inherit);
737if (!attributeType.IsSubclassOf(typeof(Attribute)) && attributeType != typeof(Attribute))
743public static Attribute? GetCustomAttribute(Assembly element, Type attributeType)
748public static Attribute? GetCustomAttribute(Assembly element, Type attributeType, bool inherit)
752Attribute[] attrib = GetCustomAttributes(element, attributeType, inherit);
757Attribute match = attrib[0];
System.Private.Windows.Core.TestUtilities (1)
System.Reflection.Context (19)
System.Reflection.DispatchProxy (1)
src\libraries\Common\src\System\Reflection\Emit\IgnoreAccessChecksToAttributeBuilder.cs (1)
24typeof(Attribute));
System.Runtime (1)
System.Runtime.InteropServices (4)
System.Runtime.Serialization.Formatters (1)
System.Text.Json (5)
System.Windows.Forms (82)
System.Windows.Forms.Design (50)
System.Windows.Forms.Primitives (6)
System.Windows.Forms.Tests (27)
System.Xaml (16)