2018 types derived from Attribute
ApiExplorerWebSite (3)
ApplicationModelWebSite (9)
Aspire.Azure.AI.Inference (2)
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.Dashboard.Components.Tests (1)
Aspire.Dashboard.Tests (1)
Aspire.Hosting (3)
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 (6)
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)
Aspire.TestUtilities (5)
BasicTestApp (1)
BasicWebSite (3)
BuildActionTelemetryTable (2)
CodeStyleConfigFileGenerator (2)
ConfigurationSchemaGenerator.Tests (2)
CorsWebSite (1)
DesignSurfaceExt (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)
Metrics (1)
Metrics.Legacy (1)
Microsoft.AspNetCore.Analyzers (11)
Microsoft.AspNetCore.Antiforgery (1)
Microsoft.AspNetCore.App.Analyzers (11)
Microsoft.AspNetCore.App.Analyzers.Test (1)
Microsoft.AspNetCore.App.SourceGenerators (11)
Microsoft.AspNetCore.App.UnitTests (1)
Microsoft.AspNetCore.Authorization (2)
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.Tests (2)
Microsoft.AspNetCore.Cryptography.KeyDerivation.Tests (2)
Microsoft.AspNetCore.DataProtection (1)
Microsoft.AspNetCore.DataProtection.Extensions.Tests (3)
Microsoft.AspNetCore.DataProtection.Tests (5)
Microsoft.AspNetCore.Grpc.Microbenchmarks (1)
Microsoft.AspNetCore.Hosting.Abstractions (1)
Microsoft.AspNetCore.Http (2)
Microsoft.AspNetCore.Http.Abstractions (2)
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.Http.ValidationsGenerator (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 (19)
Microsoft.AspNetCore.JsonPatch (17)
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.OpenApi.SourceGenerators (11)
Microsoft.AspNetCore.OutputCaching (1)
Microsoft.AspNetCore.OutputCaching.Microbenchmarks (1)
Microsoft.AspNetCore.Owin.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.FunctionalTests (1)
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 (4)
Microsoft.Bcl.Numerics (4)
Microsoft.Build.Framework (21)
Microsoft.Build.Tasks.CodeAnalysis (10)
Microsoft.Build.Tasks.CodeAnalysis.Sdk (10)
Microsoft.Build.Tasks.CodeAnalysis.UnitTests (1)
Microsoft.Build.UnitTests.Shared (2)
Microsoft.CodeAnalysis (10)
Microsoft.CodeAnalysis.Analyzers (1)
Microsoft.CodeAnalysis.AnalyzerUtilities (1)
Microsoft.CodeAnalysis.BannedApiAnalyzers (1)
Microsoft.CodeAnalysis.CodeStyle (12)
Microsoft.CodeAnalysis.CodeStyle.UnitTestUtilities (1)
Microsoft.CodeAnalysis.Collections.Package (10)
Microsoft.CodeAnalysis.Contracts.Package (9)
Microsoft.CodeAnalysis.CSharp.ExpressionEvaluator.ResultProvider (1)
Microsoft.CodeAnalysis.CSharp.Workspaces.UnitTests (1)
Microsoft.CodeAnalysis.Debugging.Package (10)
Microsoft.CodeAnalysis.ExpressionEvaluator.FunctionResolver (9)
Microsoft.CodeAnalysis.ExpressionEvaluator.ResultProvider (9)
Microsoft.CodeAnalysis.ExpressionEvaluator.ResultProvider.Utilities (11)
Microsoft.CodeAnalysis.Extensions.Package (10)
Microsoft.CodeAnalysis.Features.Test.Utilities (1)
Microsoft.CodeAnalysis.InteractiveHost (11)
Microsoft.CodeAnalysis.LanguageServer.Protocol (2)
Microsoft.CodeAnalysis.PooledObjects.Package (10)
Microsoft.CodeAnalysis.PublicApiAnalyzers (1)
Microsoft.CodeAnalysis.ResxSourceGenerator (1)
Microsoft.CodeAnalysis.Test.Utilities (3)
Microsoft.CodeAnalysis.Threading.Package (10)
Microsoft.CodeAnalysis.UnitTests (2)
Microsoft.CodeAnalysis.Workspaces (7)
Microsoft.CodeAnalysis.Workspaces.MSBuild.BuildHost (10)
Microsoft.CommonLanguageServerProtocol.Framework.Example (2)
Microsoft.CommonLanguageServerProtocol.Framework.Package (10)
Microsoft.DotNet.SwaggerGenerator.CodeGenerator (2)
Microsoft.DotNet.XUnitExtensions (10)
Microsoft.DotNet.XUnitV3Extensions (10)
Microsoft.Extensions.AI (21)
Microsoft.Extensions.AI.Abstractions (22)
Microsoft.Extensions.AI.AzureAIInference (20)
Microsoft.Extensions.AI.Evaluation (19)
Microsoft.Extensions.AI.Evaluation.Quality (20)
Microsoft.Extensions.AI.Evaluation.Reporting (19)
Microsoft.Extensions.AI.Evaluation.Reporting.Azure (19)
Microsoft.Extensions.AI.Evaluation.Safety (19)
Microsoft.Extensions.AI.Ollama (21)
Microsoft.Extensions.AI.OpenAI (22)
Microsoft.Extensions.AsyncState (20)
Microsoft.Extensions.Caching.Hybrid (20)
Microsoft.Extensions.Caching.SqlServer (12)
Microsoft.Extensions.Compliance.Abstractions (21)
Microsoft.Extensions.Compliance.Redaction (21)
Microsoft.Extensions.Configuration.Abstractions (1)
Microsoft.Extensions.Configuration.UserSecrets (1)
Microsoft.Extensions.DependencyInjection.Abstractions (3)
Microsoft.Extensions.DependencyInjection.AutoActivation (19)
Microsoft.Extensions.Features.Tests (11)
Microsoft.Extensions.Http.Polly (11)
Microsoft.Extensions.Identity.Core (1)
Microsoft.Extensions.Localization (2)
Microsoft.Extensions.Logging.Abstractions (2)
Microsoft.Extensions.Logging.Generators (12)
Microsoft.Extensions.ObjectPool.DependencyInjection (19)
Microsoft.Extensions.ObjectPool.Microbenchmark (1)
Microsoft.Extensions.Options (3)
Microsoft.Extensions.Options.Contextual (21)
Microsoft.Extensions.Options.SourceGeneration (12)
Microsoft.Extensions.Telemetry.Abstractions (10)
Microsoft.Gen.ContextualOptions.Generated.Tests (1)
Microsoft.Interop.ComInterfaceGenerator (13)
Microsoft.Interop.JavaScript.JSImportGenerator (13)
Microsoft.Interop.LibraryImportGenerator (13)
Microsoft.Interop.LibraryImportGenerator.Downlevel (13)
Microsoft.Interop.SourceGeneration (16)
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 (10)
Roslyn.Diagnostics.Analyzers (1)
RoutingSandbox (2)
SemanticSearch.BuildTask (2)
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 (3)
System.Linq.Expressions (1)
System.Net.Quic (1)
System.ObjectModel (3)
System.Private.CoreLib (225)
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 (12)
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 (12)
System.ServiceModel.Primitives.Tests (2)
System.Text.Json (2)
System.Text.Json.SourceGeneration (16)
System.Text.RegularExpressions (1)
System.Text.RegularExpressions.Generator (12)
System.Windows.Forms (7)
System.Windows.Forms.Design (1)
System.Windows.Forms.Tests (3)
System.Xaml (23)
Test.Utilities (2)
Text.Analyzers (1)
UnitTests.Common (1)
VersioningWebSite (1)
Xunit.NetCore.Extensions (1)
1 instantiation of Attribute
System.Runtime.InteropServices (1)
939 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.Components (2)
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 (3)
Microsoft.AspNetCore.Shared.Tests (1)
Microsoft.Build.Tasks.Core (2)
Microsoft.CodeAnalysis.CodeStyle (1)
Microsoft.CodeAnalysis.CSharp (2)
Microsoft.CodeAnalysis.Extensions.Package (1)
Microsoft.CodeAnalysis.Features (4)
Microsoft.CodeAnalysis.LanguageServer.Protocol (1)
Microsoft.CodeAnalysis.VisualBasic (1)
Microsoft.CodeAnalysis.Workspaces (1)
Microsoft.CommonLanguageServerProtocol.Framework.Package (1)
Microsoft.CSharp (1)
Microsoft.DotNet.Build.Tasks.Feed (2)
Microsoft.Extensions.AI.Abstractions (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() };
204foreach (Attribute attr in member.GetCustomAttributes(typeof(Attribute), false))
223internal IEnumerable<Attribute> BuildTypeAttributes(Type type)
225var attributes = new List<Attribute>();
335internal bool BuildConstructorAttributes(Type type, ref List<Tuple<object, List<Attribute>>> configuredMembers)
376internal static void BuildDefaultConstructorAttributes(Type type, ref List<Tuple<object, List<Attribute>>> configuredMembers)
386private static void ConfigureConstructorAttributes(ConstructorInfo constructorInfo, ref List<Tuple<object, List<Attribute>>> configuredMembers, Action<ParameterInfo, ImportBuilder> configureConstructorImports)
388configuredMembers ??= new List<Tuple<object, List<Attribute>>>();
410List<Attribute> attributes = null;
417internal void BuildPropertyAttributes(Type type, ref List<Tuple<object, List<Attribute>>> configuredMembers)
423List<Attribute> attributes = null;
503configuredMembers ??= 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)
199public static TypeDescriptionProvider AddAttributes(Type type, params Attribute[] attributes)
221public static TypeDescriptionProvider AddAttributes(object instance, params Attribute[] attributes)
464params Attribute[] attributes)
476params Attribute[] attributes)
524params Attribute[] attributes)
537params Attribute[] attributes)
570private static ArrayList? FilterMembers(IList members, Attribute[] attributes)
785Attribute[] attrArray = new Attribute[results.Count];
1128Attribute[] attributes)
1176public static EventDescriptorCollection GetEvents(object component, Attribute[] attributes)
1187public static EventDescriptorCollection GetEvents(object component, Attribute[]? attributes, bool noCustomTypeDesc)
1365Attribute[]? attributes)
1422public static PropertyDescriptorCollection GetProperties(object component, Attribute[]? attributes)
1433public static PropertyDescriptorCollection GetProperties(object component, Attribute[]? attributes, bool noCustomTypeDesc)
1444private static PropertyDescriptorCollection GetPropertiesImpl(object component, Attribute[]? attributes, bool noCustomTypeDesc, bool noAttributes)
1883private static ICollection PipelineAttributeFilter(int pipelineType, ICollection members, Attribute[]? filter, IDictionary? cache)
2002foreach (Attribute attr in members)
2097Attribute[] attrArray = new Attribute[list.Count];
2104throw new ArgumentException(SR.Format(SR.TypeDescriptorExpectedElementType, typeof(Attribute).FullName));
2259Attribute[] attrArray = new Attribute[list.Count];
2736private static bool ShouldHideMember(MemberDescriptor? member, Attribute? attribute)
2743Attribute? memberAttribute = member.Attributes[attribute.GetType()];
2857EventDescriptorCollection ICustomTypeDescriptor.GetEvents(Attribute[]? attributes)
2869PropertyDescriptorCollection ICustomTypeDescriptor.GetProperties(Attribute[]? attributes)
2885private readonly Attribute[] _attrs;
2890internal AttributeProvider(TypeDescriptionProvider existingProvider, params Attribute[] attrs) : base(existingProvider)
2908private readonly Attribute[] _attributeArray;
2914internal AttributeTypeDescriptor(Attribute[] attrs, ICustomTypeDescriptor? parent) : base(parent)
2927Attribute[]? finalAttr;
2929Attribute[] newAttrs = _attributeArray;
2930Attribute[] newArray = new Attribute[existing.Count + newAttrs.Length];
2960finalAttr = new Attribute[actualCount];
2980private readonly Attribute[] _filter;
2983internal AttributeFilterCacheItem(Attribute[] filter, ICollection filteredMembers)
2989internal bool IsValid(Attribute[] filter)
3184EventDescriptorCollection ICustomTypeDescriptor.GetEvents(Attribute[]? attributes)
3208PropertyDescriptorCollection ICustomTypeDescriptor.GetProperties(Attribute[]? attributes)
3659EventDescriptorCollection ICustomTypeDescriptor.GetEvents(Attribute[]? attributes)
3729PropertyDescriptorCollection ICustomTypeDescriptor.GetProperties(Attribute[]? attributes)
4070public EventDescriptorCollection GetEvents(Attribute[]? attributes)
4156public 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>>();
114private List<Tuple<object, List<Attribute>>> EvaluateThisTypeInfoAgainstTheConvention(TypeInfo typeInfo)
116List<Attribute> attributes = new List<Attribute>();
117var configuredMembers = new List<Tuple<object, List<Attribute>>>();
147public override IEnumerable<Attribute> GetCustomAttributes(Type reflectedType, System.Reflection.MemberInfo member)
152List<Attribute> cachedAttributes = null;
174List<Attribute> attributeList;
175foreach (Tuple<object, List<Attribute>> element in EvaluateThisTypeInfoAgainstTheConvention(typeInfo))
185if (!_memberInfos.TryGetValue(mi, out List<Attribute> memberAttributes))
200if (!_parameters.TryGetValue(pi, out List<Attribute> parameterAttributes))
223IEnumerable<Attribute> appliedAttributes;
225appliedAttributes = Enumerable.Empty<Attribute>();
227appliedAttributes = member.GetCustomAttributes<Attribute>(false);
232private List<Attribute> ReadMemberCustomAttributes(Type reflectedType, System.Reflection.MemberInfo member)
234List<Attribute> cachedAttributes = null;
284public override IEnumerable<Attribute> GetCustomAttributes(Type reflectedType, System.Reflection.ParameterInfo parameter)
288IEnumerable<Attribute> attributes = parameter.GetCustomAttributes<Attribute>(false);
289List<Attribute> cachedAttributes = ReadParameterCustomAttributes(reflectedType, parameter);
293private List<Attribute> ReadParameterCustomAttributes(Type reflectedType, System.Reflection.ParameterInfo parameter)
295List<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() };
401foreach (Attribute attr in member.GetCustomAttributes<Attribute>(false))
420internal IEnumerable<Attribute> BuildTypeAttributes(Type type)
422var attributes = new List<Attribute>();
529internal bool BuildConstructorAttributes(Type type, ref List<Tuple<object, List<Attribute>>> configuredMembers)
537Attribute[] attributes = Attribute.GetCustomAttributes(ci, typeof(ImportingConstructorAttribute), false);
567internal static void BuildDefaultConstructorAttributes(Type type, ref List<Tuple<object, List<Attribute>>> configuredMembers)
577private static void ConfigureConstructorAttributes(ConstructorInfo constructorInfo, ref List<Tuple<object, List<Attribute>>> configuredMembers, Action<ParameterInfo, ImportConventionBuilder> configureConstructorImports)
579configuredMembers ??= new List<Tuple<object, List<Attribute>>>();
601List<Attribute> attributes = null;
608internal void BuildOnImportsSatisfiedNotification(Type type, ref List<Tuple<object, List<Attribute>>> configuredMembers)
646var onImportsSatisfiedAttributeList = new List<Attribute>
652configuredMembers.Add(new Tuple<object, List<Attribute>>(mi, s_onImportsSatisfiedAttributeList));
662internal void BuildPropertyAttributes(Type type, ref List<Tuple<object, List<Attribute>>> configuredMembers)
668List<Attribute> attributes = null;
748configuredMembers ??= 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.Private.CoreLib (188)
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];
src\System\Reflection\RuntimeCustomAttributeData.cs (30)
23RuntimeType.ListBuilder<Attribute> pcas = default;
33RuntimeType.ListBuilder<Attribute> pcas = default;
43RuntimeType.ListBuilder<Attribute> pcas = default;
92RuntimeType.ListBuilder<Attribute> pcas = default;
98private static ReadOnlyCollection<CustomAttributeData> GetCombinedList(IList<CustomAttributeData> customAttributes, ref RuntimeType.ListBuilder<Attribute> pseudoAttributes)
303internal RuntimeCustomAttributeData(Attribute attribute)
1254RuntimeType.ListBuilder<Attribute> pcas = default;
1296RuntimeType.ListBuilder<Attribute> pcas = default;
1365RuntimeType.ListBuilder<Attribute> pcas = default;
1377RuntimeType.ListBuilder<Attribute> pcas = default;
1804if (caType == typeof(Attribute))
1814if (caType.IsSubclassOf(typeof(Attribute)))
1826return elementCount == 0 ? Array.Empty<Attribute>() : new Attribute[elementCount];
1968Debug.Assert(pca.BaseType == typeof(Attribute), "Pseudo CA Error - Incorrect base type");
1983internal static void GetCustomAttributes(RuntimeType type, RuntimeType caType, ref RuntimeType.ListBuilder<Attribute> pcas)
1988bool all = caType == typeof(object) || caType == typeof(Attribute);
2007bool all = caType == typeof(object) || caType == typeof(Attribute);
2027internal static void GetCustomAttributes(RuntimeMethodInfo method, RuntimeType caType, ref RuntimeType.ListBuilder<Attribute> pcas)
2032bool all = caType == typeof(object) || caType == typeof(Attribute);
2038Attribute? pca = GetDllImportCustomAttribute(method);
2049bool all = caType == typeof(object) || caType == typeof(Attribute);
2067internal static void GetCustomAttributes(RuntimeParameterInfo parameter, RuntimeType caType, ref RuntimeType.ListBuilder<Attribute> pcas)
2072bool all = caType == typeof(object) || caType == typeof(Attribute);
2093Attribute? pca = GetMarshalAsCustomAttribute(parameter);
2099bool all = caType == typeof(object) || caType == typeof(Attribute);
2123internal static void GetCustomAttributes(RuntimeFieldInfo field, RuntimeType caType, ref RuntimeType.ListBuilder<Attribute> pcas)
2128bool all = caType == typeof(object) || caType == typeof(Attribute);
2132Attribute? pca;
2154bool all = caType == typeof(object) || caType == typeof(Attribute);
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 (6)
System.Windows.Forms (82)
System.Windows.Forms.Design (51)
System.Windows.Forms.Design.Tests (7)
System.Windows.Forms.Primitives (6)
System.Windows.Forms.Tests (29)
System.Xaml (16)
System.Xaml.Tests (8)