namespace System.ComponentModel.DataAnnotations
{
-// TODO-NULLABLE: Enable after System.ComponentModel.TypeDescriptionProvider is annotated
+ // TODO-NULLABLE: Enable after System.ComponentModel.TypeDescriptionProvider is annotated
#nullable disable
public partial class AssociatedMetadataTypeTypeDescriptionProvider : System.ComponentModel.TypeDescriptionProvider
{
public AssociatedMetadataTypeTypeDescriptionProvider(System.Type type) { }
- public AssociatedMetadataTypeTypeDescriptionProvider(System.Type type, System.Type associatedMetadataType) { }
- public override System.ComponentModel.ICustomTypeDescriptor GetTypeDescriptor(System.Type objectType, object instance) { throw null; }
+ public AssociatedMetadataTypeTypeDescriptionProvider(System.Type type, [System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembers(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.All)] System.Type associatedMetadataType) { }
+ public override System.ComponentModel.ICustomTypeDescriptor GetTypeDescriptor([System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembers(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.All)] System.Type objectType, object instance) { throw null; }
}
#nullable enable
[System.AttributeUsageAttribute(System.AttributeTargets.Field | System.AttributeTargets.Property, AllowMultiple=false, Inherited=true)]
[System.AttributeUsageAttribute(System.AttributeTargets.Class, AllowMultiple=false)]
public sealed partial class MetadataTypeAttribute : System.Attribute
{
- public MetadataTypeAttribute(System.Type metadataClassType) { }
+ public MetadataTypeAttribute([System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembers(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.All)] System.Type metadataClassType) { }
+ [System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembers(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.All)]
public System.Type MetadataClassType { get { throw null; } }
}
[System.AttributeUsageAttribute(System.AttributeTargets.Field | System.AttributeTargets.Parameter | System.AttributeTargets.Property, AllowMultiple=false)]
{
public RangeAttribute(double minimum, double maximum) { }
public RangeAttribute(int minimum, int maximum) { }
- public RangeAttribute(System.Type type, string minimum, string maximum) { }
+ public RangeAttribute([System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembers(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.All)] System.Type type, string minimum, string maximum) { }
public bool ConvertValueInInvariantCulture { get { throw null; } set { } }
public object Maximum { get { throw null; } }
public object Minimum { get { throw null; } }
+ [System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembers(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.All)]
public System.Type OperandType { get { throw null; } }
public bool ParseLimitsInInvariantCulture { get { throw null; } set { } }
public override string FormatErrorMessage(string name) { throw null; }
</PropertyGroup>
<ItemGroup>
<Compile Include="System.ComponentModel.Annotations.cs" />
+ <Compile Include="$(CoreLibSharedDir)System\Diagnostics\CodeAnalysis\DynamicallyAccessedMembersAttribute.cs" />
+ <Compile Include="$(CoreLibSharedDir)System\Diagnostics\CodeAnalysis\DynamicallyAccessedMemberTypes.cs" />
</ItemGroup>
</Project>
\ No newline at end of file
<assembly fullname="System.ComponentModel.Annotations, PublicKeyToken=b03f5f7f11d50a3a">
<attribute fullname="System.Diagnostics.CodeAnalysis.UnconditionalSuppressMessageAttribute">
<argument>ILLink</argument>
- <argument>IL2070</argument>
- <property name="Scope">member</property>
- <property name="Target">M:System.ComponentModel.DataAnnotations.AssociatedMetadataTypeTypeDescriptor.TypeDescriptorCache.CheckAssociatedMetadataType(System.Type,System.Type)</property>
- </attribute>
- <attribute fullname="System.Diagnostics.CodeAnalysis.UnconditionalSuppressMessageAttribute">
- <argument>ILLink</argument>
- <argument>IL2070</argument>
- <property name="Scope">member</property>
- <property name="Target">M:System.ComponentModel.DataAnnotations.AssociatedMetadataTypeTypeDescriptor.TypeDescriptorCache.GetAssociatedMetadata(System.Type,System.String)</property>
- </attribute>
- <attribute fullname="System.Diagnostics.CodeAnalysis.UnconditionalSuppressMessageAttribute">
- <argument>ILLink</argument>
<argument>IL2072</argument>
<property name="Scope">member</property>
<property name="Target">M:System.ComponentModel.DataAnnotations.CompareAttribute.IsValid(System.Object,System.ComponentModel.DataAnnotations.ValidationContext)</property>
<property name="Target">M:System.ComponentModel.DataAnnotations.ValidationAttribute.SetResourceAccessorByPropertyLookup</property>
</attribute>
</assembly>
-</linker>
\ No newline at end of file
+</linker>
<Compile Include="$(CommonPath)System\NotImplemented.cs"
Link="Common\System\NotImplemented.cs" />
</ItemGroup>
+ <ItemGroup Condition="$([MSBuild]::GetTargetFrameworkIdentifier('$(TargetFramework)')) != '.NETCoreApp'">
+ <Compile Include="$(CoreLibSharedDir)System\Diagnostics\CodeAnalysis\DynamicallyAccessedMembersAttribute.cs" />
+ <Compile Include="$(CoreLibSharedDir)System\Diagnostics\CodeAnalysis\DynamicallyAccessedMemberTypes.cs" />
+ <Compile Include="$(CoreLibSharedDir)System\Diagnostics\CodeAnalysis\RequiresUnreferencedCodeAttribute.cs" />
+ </ItemGroup>
<ItemGroup Condition="$([MSBuild]::GetTargetFrameworkIdentifier('$(TargetFramework)')) == '.NETCoreApp'">
<Reference Include="System.Collections" />
<Reference Include="System.Collections.Concurrent" />
// TODO-NULLABLE: Enable after System.ComponentModel.TypeDescriptionProvider is annotated
#nullable disable
+using System.Diagnostics.CodeAnalysis;
+
namespace System.ComponentModel.DataAnnotations
{
/// <summary>
/// </summary>
public class AssociatedMetadataTypeTypeDescriptionProvider : TypeDescriptionProvider
{
+ [DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)]
private readonly Type _associatedMetadataType;
/// <summary>
/// <param name="type">The type for which the metadata provider is created.</param>
/// <param name="associatedMetadataType">The associated type that contains the metadata.</param>
/// <exception cref="System.ArgumentNullException">The value of associatedMetadataType is null.</exception>
- public AssociatedMetadataTypeTypeDescriptionProvider(Type type, Type associatedMetadataType)
+ public AssociatedMetadataTypeTypeDescriptionProvider(
+ Type type,
+ [DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] Type associatedMetadataType)
: this(type)
{
if (associatedMetadataType == null)
/// <param name="objectType">The type of object to retrieve the type descriptor for.</param>
/// <param name="instance">An instance of the type.</param>
/// <returns>The descriptor that provides metadata for the type.</returns>
- public override ICustomTypeDescriptor GetTypeDescriptor(Type objectType, object instance)
+ public override ICustomTypeDescriptor GetTypeDescriptor([DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] Type objectType, object instance)
{
ICustomTypeDescriptor baseDescriptor = base.GetTypeDescriptor(objectType, instance);
return new AssociatedMetadataTypeTypeDescriptor(baseDescriptor, objectType, _associatedMetadataType);
using System.Collections.Concurrent;
using System.Collections.Generic;
-using System.Globalization;
+using System.Diagnostics.CodeAnalysis;
using System.Linq;
using System.Reflection;
{
internal class AssociatedMetadataTypeTypeDescriptor : CustomTypeDescriptor
{
+ [DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)]
private Type AssociatedMetadataType { get; set; }
private bool IsSelfAssociated { get; set; }
- public AssociatedMetadataTypeTypeDescriptor(ICustomTypeDescriptor parent, Type type, Type associatedMetadataType)
+ public AssociatedMetadataTypeTypeDescriptor(
+ ICustomTypeDescriptor parent,
+ [DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicProperties)] Type type,
+ [DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] Type associatedMetadataType)
: base(parent)
{
AssociatedMetadataType = associatedMetadataType ?? TypeDescriptorCache.GetAssociatedMetadataType(type);
}
}
+ [RequiresUnreferencedCode("The public parameterless constructor or the 'Default' static field may be trimmed from the Attribute's Type.")]
public override PropertyDescriptorCollection GetProperties(Attribute[] attributes)
{
return GetPropertiesWithMetadata(base.GetProperties(attributes));
// Stores whether or not a type and associated metadata type has been checked for validity
private static readonly ConcurrentDictionary<(Type, Type), bool> s_validatedMetadataTypeCache = new ConcurrentDictionary<(Type, Type), bool>();
- public static void ValidateMetadataType(Type type, Type associatedType)
+ public static void ValidateMetadataType(
+ [DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicProperties)] Type type,
+ [DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicFields | DynamicallyAccessedMemberTypes.PublicProperties)] Type associatedType)
{
(Type, Type) typeTuple = (type, associatedType);
if (!s_validatedMetadataTypeCache.ContainsKey(typeTuple))
}
}
+ [return: DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)]
public static Type GetAssociatedMetadataType(Type type)
{
Type associatedMetadataType = null;
return associatedMetadataType;
}
- private static void CheckAssociatedMetadataType(Type mainType, Type associatedMetadataType)
+ private static void CheckAssociatedMetadataType(
+ [DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicProperties)] Type mainType,
+ [DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicFields | DynamicallyAccessedMemberTypes.PublicProperties)] Type associatedMetadataType)
{
// Only properties from main type
HashSet<string> mainTypeMemberNames = new HashSet<string>(mainType.GetProperties().Select(p => p.Name));
}
}
- public static Attribute[] GetAssociatedMetadata(Type type, string memberName)
+ public static Attribute[] GetAssociatedMetadata(
+ [DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] Type type,
+ string memberName)
{
(Type, string) memberTuple = (type, memberName);
Attribute[] attributes;
// The .NET Foundation licenses this file to you under the MIT license.
using System;
+using System.Diagnostics.CodeAnalysis;
namespace System.ComponentModel.DataAnnotations
{
[AttributeUsage(AttributeTargets.Class, AllowMultiple = false)]
public sealed class MetadataTypeAttribute : Attribute
{
+ [DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)]
private readonly Type _metadataClassType;
/// <summary>
/// </summary>
/// <param name="metadataClassType">The metadata class to reference.</param>
/// <exception cref="System.ArgumentNullException">metadataClassType is null.</exception>
- public MetadataTypeAttribute(Type metadataClassType)
+ public MetadataTypeAttribute([DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] Type metadataClassType)
{
_metadataClassType = metadataClassType;
}
/// <summary>
/// Gets the metadata class that is associated with a data-model partial class.
/// </summary>
+ [DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)]
public Type MetadataClassType
{
get
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
+using System.Diagnostics.CodeAnalysis;
using System.Globalization;
namespace System.ComponentModel.DataAnnotations
/// <param name="type">The type of the range parameters. Must implement IComparable.</param>
/// <param name="minimum">The minimum allowable value.</param>
/// <param name="maximum">The maximum allowable value.</param>
- public RangeAttribute(Type type, string minimum, string maximum)
+ public RangeAttribute(
+ [DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] Type type,
+ string minimum,
+ string maximum)
: base(() => SR.RangeAttribute_ValidationError)
{
OperandType = type;
/// Gets the type of the <see cref="Minimum" /> and <see cref="Maximum" /> values (e.g. Int32, Double, or some custom
/// type)
/// </summary>
+ [DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)]
public Type OperandType { get; }
/// <summary>
comparableType.FullName));
}
- TypeConverter converter = TypeDescriptor.GetConverter(type);
+ // use OperandType here so the trimmer doesn't warn about the 'type' field on a compiler generated type
+ TypeConverter converter = TypeDescriptor.GetConverter(OperandType);
IComparable min = (IComparable)(ParseLimitsInInvariantCulture
? converter.ConvertFromInvariantString((string)minimum)
: converter.ConvertFromString((string)minimum));
{
System.ComponentModel.ComponentCollection Components { get; }
void Add(System.ComponentModel.IComponent? component);
+ [System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("The Type of components in the container cannot be statically discovered to validate the name.")]
void Add(System.ComponentModel.IComponent? component, string? name);
void Remove(System.ComponentModel.IComponent? component);
}
System.ComponentModel.IComponent Component { get; }
System.ComponentModel.IContainer? Container { get; }
bool DesignMode { get; }
- string? Name { get; set; }
+ string? Name { get; [System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("The Type of components in the container cannot be statically discovered to validate the name.")] set; }
}
public partial interface ISupportInitialize
{
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
-using System.Runtime.InteropServices;
+using System.Diagnostics.CodeAnalysis;
namespace System.ComponentModel
{
/// <see cref='System.ComponentModel.IContainer'/> at the end of the list,
/// and assigns a name to the component.
/// </summary>
+ [RequiresUnreferencedCode("The Type of components in the container cannot be statically discovered to validate the name.")]
void Add(IComponent? component, string? name);
/// <summary>
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
+using System.Diagnostics.CodeAnalysis;
+
namespace System.ComponentModel
{
/// <summary>
/// When implemented by a class, gets or sets the name of the component
/// associated with the <see cref='System.ComponentModel.ISite'/>.
/// </summary>
- string? Name { get; set; }
+ string? Name { get; [RequiresUnreferencedCode("The Type of components in the container cannot be statically discovered to validate the name.")] set; }
}
}
public AmbientValueAttribute(object value) { }
public AmbientValueAttribute(float value) { }
public AmbientValueAttribute(string value) { }
- public AmbientValueAttribute(System.Type type, string value) { }
+ public AmbientValueAttribute([System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembers(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.All)] System.Type type, string value) { }
public object Value { get { throw null; } }
public override bool Equals(object obj) { throw null; }
public override int GetHashCode() { throw null; }
{
public ArrayConverter() { }
public override object ConvertTo(System.ComponentModel.ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value, System.Type destinationType) { throw null; }
+ [System.Diagnostics.CodeAnalysis.RequiresUnreferencedCodeAttribute("The Type of value cannot be statically discovered. The public parameterless constructor or the 'Default' static field may be trimmed from the Attribute's Type.")]
public override System.ComponentModel.PropertyDescriptorCollection GetProperties(System.ComponentModel.ITypeDescriptorContext context, object value, System.Attribute[] attributes) { throw null; }
public override bool GetPropertiesSupported(System.ComponentModel.ITypeDescriptorContext context) { throw null; }
}
protected virtual System.Attribute[] Attributes { get { throw null; } }
public int Count { get { throw null; } }
public virtual System.Attribute this[int index] { get { throw null; } }
- public virtual System.Attribute this[System.Type attributeType] { get { throw null; } }
+ public virtual System.Attribute this[[System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembersAttribute(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.PublicFields | System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.PublicParameterlessConstructor)] System.Type attributeType] { get { throw null; } }
int System.Collections.ICollection.Count { get { throw null; } }
bool System.Collections.ICollection.IsSynchronized { get { throw null; } }
object System.Collections.ICollection.SyncRoot { get { throw null; } }
+ [System.Diagnostics.CodeAnalysis.RequiresUnreferencedCodeAttribute("The public parameterless constructor or the 'Default' static field may be trimmed from the Attribute's Type.")]
public bool Contains(System.Attribute attribute) { throw null; }
+ [System.Diagnostics.CodeAnalysis.RequiresUnreferencedCodeAttribute("The public parameterless constructor or the 'Default' static field may be trimmed from the Attribute's Type.")]
public bool Contains(System.Attribute[] attributes) { throw null; }
public void CopyTo(System.Array array, int index) { }
public static System.ComponentModel.AttributeCollection FromExisting(System.ComponentModel.AttributeCollection existing, params System.Attribute[] newAttributes) { throw null; }
- protected System.Attribute GetDefaultAttribute(System.Type attributeType) { throw null; }
+ protected System.Attribute GetDefaultAttribute([System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembersAttribute(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.PublicFields | System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.PublicParameterlessConstructor)] System.Type attributeType) { throw null; }
public System.Collections.IEnumerator GetEnumerator() { throw null; }
public bool Matches(System.Attribute attribute) { throw null; }
public bool Matches(System.Attribute[] attributes) { throw null; }
OneWay = 0,
TwoWay = 1,
}
- public partial class BindingList<T> : System.Collections.ObjectModel.Collection<T>, System.Collections.ICollection, System.Collections.IEnumerable, System.Collections.IList, System.ComponentModel.IBindingList, System.ComponentModel.ICancelAddNew, System.ComponentModel.IRaiseItemChangedEvents
+ public partial class BindingList<[System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembers(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.All)] T> : System.Collections.ObjectModel.Collection<T>, System.Collections.ICollection, System.Collections.IEnumerable, System.Collections.IList, System.ComponentModel.IBindingList, System.ComponentModel.ICancelAddNew, System.ComponentModel.IRaiseItemChangedEvents
{
public BindingList() { }
public BindingList(System.Collections.Generic.IList<T> list) { }
{
public CollectionConverter() { }
public override object ConvertTo(System.ComponentModel.ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value, System.Type destinationType) { throw null; }
+ [System.Diagnostics.CodeAnalysis.RequiresUnreferencedCodeAttribute("The Type of value cannot be statically discovered. The public parameterless constructor or the 'Default' static field may be trimmed from the Attribute's Type.")]
public override System.ComponentModel.PropertyDescriptorCollection GetProperties(System.ComponentModel.ITypeDescriptorContext context, object value, System.Attribute[] attributes) { throw null; }
public override bool GetPropertiesSupported(System.ComponentModel.ITypeDescriptorContext context) { throw null; }
}
public partial class ComponentConverter : System.ComponentModel.ReferenceConverter
{
public ComponentConverter(System.Type type) : base (default(System.Type)) { }
+ [System.Diagnostics.CodeAnalysis.RequiresUnreferencedCodeAttribute("The Type of value cannot be statically discovered. The public parameterless constructor or the 'Default' static field may be trimmed from the Attribute's Type.")]
public override System.ComponentModel.PropertyDescriptorCollection GetProperties(System.ComponentModel.ITypeDescriptorContext context, object value, System.Attribute[] attributes) { throw null; }
public override bool GetPropertiesSupported(System.ComponentModel.ITypeDescriptorContext context) { throw null; }
}
{
public ComponentResourceManager() { }
public ComponentResourceManager(System.Type t) { }
+ [System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("The Type of value cannot be statically discovered.")]
public void ApplyResources(object value, string objectName) { }
+ [System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("The Type of value cannot be statically discovered.")]
public virtual void ApplyResources(object value, string objectName, System.Globalization.CultureInfo culture) { }
}
public partial class Container : System.ComponentModel.IContainer, System.IDisposable
public Container() { }
public virtual System.ComponentModel.ComponentCollection Components { get { throw null; } }
public virtual void Add(System.ComponentModel.IComponent component) { }
+ [System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("The Type of components in the container cannot be statically discovered to validate the name.")]
public virtual void Add(System.ComponentModel.IComponent component, string name) { }
protected virtual System.ComponentModel.ISite CreateSite(System.ComponentModel.IComponent component, string name) { throw null; }
public void Dispose() { }
protected virtual object GetService(System.Type service) { throw null; }
public virtual void Remove(System.ComponentModel.IComponent component) { }
protected void RemoveWithoutUnsiting(System.ComponentModel.IComponent component) { }
+ [System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("The Type of components in the container cannot be statically discovered.")]
protected virtual void ValidateName(System.ComponentModel.IComponent component, string name) { }
}
public abstract partial class ContainerFilterService
public virtual System.ComponentModel.PropertyDescriptor GetDefaultProperty() { throw null; }
public virtual object GetEditor(System.Type editorBaseType) { throw null; }
public virtual System.ComponentModel.EventDescriptorCollection GetEvents() { throw null; }
+ [System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("The public parameterless constructor or the 'Default' static field may be trimmed from the Attribute's Type.")]
public virtual System.ComponentModel.EventDescriptorCollection GetEvents(System.Attribute[] attributes) { throw null; }
public virtual System.ComponentModel.PropertyDescriptorCollection GetProperties() { throw null; }
+ [System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("The public parameterless constructor or the 'Default' static field may be trimmed from the Attribute's Type.")]
public virtual System.ComponentModel.PropertyDescriptorCollection GetProperties(System.Attribute[] attributes) { throw null; }
public virtual object GetPropertyOwner(System.ComponentModel.PropertyDescriptor pd) { throw null; }
}
}
public partial class EnumConverter : System.ComponentModel.TypeConverter
{
- public EnumConverter(System.Type type) { }
+ public EnumConverter([System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembersAttribute(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.PublicFields | System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.PublicParameterlessConstructor)] System.Type type) { }
protected virtual System.Collections.IComparer Comparer { get { throw null; } }
+ [System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembersAttribute(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.PublicFields | System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.PublicParameterlessConstructor)]
protected System.Type EnumType { get { throw null; } }
protected System.ComponentModel.TypeConverter.StandardValuesCollection Values { get { throw null; } set { } }
public override bool CanConvertFrom(System.ComponentModel.ITypeDescriptorContext context, System.Type sourceType) { throw null; }
}
public abstract partial class EventDescriptor : System.ComponentModel.MemberDescriptor
{
- protected EventDescriptor(System.ComponentModel.MemberDescriptor descr) : base (default(System.ComponentModel.MemberDescriptor)) { }
- protected EventDescriptor(System.ComponentModel.MemberDescriptor descr, System.Attribute[] attrs) : base (default(System.ComponentModel.MemberDescriptor)) { }
- protected EventDescriptor(string name, System.Attribute[] attrs) : base (default(System.ComponentModel.MemberDescriptor)) { }
+ protected EventDescriptor(System.ComponentModel.MemberDescriptor descr) : base (default(string)) { }
+ protected EventDescriptor(System.ComponentModel.MemberDescriptor descr, System.Attribute[] attrs) : base (default(string)) { }
+ protected EventDescriptor(string name, System.Attribute[] attrs) : base (default(string)) { }
public abstract System.Type ComponentType { get; }
public abstract System.Type EventType { get; }
public abstract bool IsMulticast { get; }
public partial class ExpandableObjectConverter : System.ComponentModel.TypeConverter
{
public ExpandableObjectConverter() { }
+ [System.Diagnostics.CodeAnalysis.RequiresUnreferencedCodeAttribute("The Type of value cannot be statically discovered. The public parameterless constructor or the 'Default' static field may be trimmed from the Attribute's Type.")]
public override System.ComponentModel.PropertyDescriptorCollection GetProperties(System.ComponentModel.ITypeDescriptorContext context, object value, System.Attribute[] attributes) { throw null; }
public override bool GetPropertiesSupported(System.ComponentModel.ITypeDescriptorContext context) { throw null; }
}
System.ComponentModel.PropertyDescriptor GetDefaultProperty();
object GetEditor(System.Type editorBaseType);
System.ComponentModel.EventDescriptorCollection GetEvents();
+ [System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("The public parameterless constructor or the 'Default' static field may be trimmed from the Attribute's Type.")]
System.ComponentModel.EventDescriptorCollection GetEvents(System.Attribute[] attributes);
System.ComponentModel.PropertyDescriptorCollection GetProperties();
+ [System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("The public parameterless constructor or the 'Default' static field may be trimmed from the Attribute's Type.")]
System.ComponentModel.PropertyDescriptorCollection GetProperties(System.Attribute[] attributes);
object GetPropertyOwner(System.ComponentModel.PropertyDescriptor pd);
}
{
public MultilineStringConverter() { }
public override object ConvertTo(System.ComponentModel.ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value, System.Type destinationType) { throw null; }
+ [System.Diagnostics.CodeAnalysis.RequiresUnreferencedCodeAttribute("The Type of value cannot be statically discovered. The public parameterless constructor or the 'Default' static field may be trimmed from the Attribute's Type.")]
public override System.ComponentModel.PropertyDescriptorCollection GetProperties(System.ComponentModel.ITypeDescriptorContext context, object value, System.Attribute[] attributes) { throw null; }
public override bool GetPropertiesSupported(System.ComponentModel.ITypeDescriptorContext context) { throw null; }
}
public override object ConvertTo(System.ComponentModel.ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value, System.Type destinationType) { throw null; }
public override object CreateInstance(System.ComponentModel.ITypeDescriptorContext context, System.Collections.IDictionary propertyValues) { throw null; }
public override bool GetCreateInstanceSupported(System.ComponentModel.ITypeDescriptorContext context) { throw null; }
+ [System.Diagnostics.CodeAnalysis.RequiresUnreferencedCodeAttribute("The Type of value cannot be statically discovered. The public parameterless constructor or the 'Default' static field may be trimmed from the Attribute's Type.")]
public override System.ComponentModel.PropertyDescriptorCollection GetProperties(System.ComponentModel.ITypeDescriptorContext context, object value, System.Attribute[] attributes) { throw null; }
public override bool GetPropertiesSupported(System.ComponentModel.ITypeDescriptorContext context) { throw null; }
public override System.ComponentModel.TypeConverter.StandardValuesCollection GetStandardValues(System.ComponentModel.ITypeDescriptorContext context) { throw null; }
}
public abstract partial class PropertyDescriptor : System.ComponentModel.MemberDescriptor
{
- protected PropertyDescriptor(System.ComponentModel.MemberDescriptor descr) : base (default(System.ComponentModel.MemberDescriptor)) { }
- protected PropertyDescriptor(System.ComponentModel.MemberDescriptor descr, System.Attribute[] attrs) : base (default(System.ComponentModel.MemberDescriptor)) { }
- protected PropertyDescriptor(string name, System.Attribute[] attrs) : base (default(System.ComponentModel.MemberDescriptor)) { }
+ protected PropertyDescriptor(System.ComponentModel.MemberDescriptor descr) : base (default(string)) { }
+ protected PropertyDescriptor(System.ComponentModel.MemberDescriptor descr, System.Attribute[] attrs) : base (default(string)) { }
+ protected PropertyDescriptor(string name, System.Attribute[] attrs) : base (default(string)) { }
public abstract System.Type ComponentType { get; }
- public virtual System.ComponentModel.TypeConverter Converter { get { throw null; } }
+ public virtual System.ComponentModel.TypeConverter Converter { [System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("The PropertyDescriptor's PropertyType cannot be statically discovered.")] get { throw null; } }
public virtual bool IsLocalizable { get { throw null; } }
public abstract bool IsReadOnly { get; }
public abstract System.Type PropertyType { get; }
protected object CreateInstance(System.Type type) { throw null; }
public override bool Equals(object obj) { throw null; }
protected override void FillAttributes(System.Collections.IList attributeList) { }
+ [System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("The PropertyDescriptor's PropertyType cannot be statically discovered.")]
public System.ComponentModel.PropertyDescriptorCollection GetChildProperties() { throw null; }
+ [System.Diagnostics.CodeAnalysis.RequiresUnreferencedCodeAttribute("The PropertyDescriptor's PropertyType cannot be statically discovered. The public parameterless constructor or the 'Default' static field may be trimmed from the Attribute's Type.")]
public System.ComponentModel.PropertyDescriptorCollection GetChildProperties(System.Attribute[] filter) { throw null; }
+ [System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("The PropertyDescriptor's PropertyType cannot be statically discovered. The Type of instance cannot be statically discovered.")]
public System.ComponentModel.PropertyDescriptorCollection GetChildProperties(object instance) { throw null; }
+ [System.Diagnostics.CodeAnalysis.RequiresUnreferencedCodeAttribute("The PropertyDescriptor's PropertyType cannot be statically discovered. The Type of instance cannot be statically discovered. The public parameterless constructor or the 'Default' static field may be trimmed from the Attribute's Type.")]
public virtual System.ComponentModel.PropertyDescriptorCollection GetChildProperties(object instance, System.Attribute[] filter) { throw null; }
+ [System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("The PropertyDescriptor's PropertyType cannot be statically discovered.")]
public virtual object GetEditor(System.Type editorBaseType) { throw null; }
public override int GetHashCode() { throw null; }
protected override object GetInvocationTarget(System.Type type, object instance) { throw null; }
protected System.Exception GetConvertToException(object value, System.Type destinationType) { throw null; }
public bool GetCreateInstanceSupported() { throw null; }
public virtual bool GetCreateInstanceSupported(System.ComponentModel.ITypeDescriptorContext context) { throw null; }
+ [System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("The Type of value cannot be statically discovered.")]
public System.ComponentModel.PropertyDescriptorCollection GetProperties(System.ComponentModel.ITypeDescriptorContext context, object value) { throw null; }
+ [System.Diagnostics.CodeAnalysis.RequiresUnreferencedCodeAttribute("The Type of value cannot be statically discovered. The public parameterless constructor or the 'Default' static field may be trimmed from the Attribute's Type.")]
public virtual System.ComponentModel.PropertyDescriptorCollection GetProperties(System.ComponentModel.ITypeDescriptorContext context, object value, System.Attribute[] attributes) { throw null; }
+ [System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("The Type of value cannot be statically discovered.")]
public System.ComponentModel.PropertyDescriptorCollection GetProperties(object value) { throw null; }
public bool GetPropertiesSupported() { throw null; }
public virtual bool GetPropertiesSupported(System.ComponentModel.ITypeDescriptorContext context) { throw null; }
protected System.ComponentModel.PropertyDescriptorCollection SortProperties(System.ComponentModel.PropertyDescriptorCollection props, string[] names) { throw null; }
protected abstract partial class SimplePropertyDescriptor : System.ComponentModel.PropertyDescriptor
{
- protected SimplePropertyDescriptor(System.Type componentType, string name, System.Type propertyType) : base (default(System.ComponentModel.MemberDescriptor)) { }
- protected SimplePropertyDescriptor(System.Type componentType, string name, System.Type propertyType, System.Attribute[] attributes) : base (default(System.ComponentModel.MemberDescriptor)) { }
+ protected SimplePropertyDescriptor(System.Type componentType, string name, System.Type propertyType) : base (default(string), default(System.Attribute[])) { }
+ protected SimplePropertyDescriptor(System.Type componentType, string name, System.Type propertyType, System.Attribute[] attributes) : base (default(string), default(System.Attribute[])) { }
public override System.Type ComponentType { get { throw null; } }
public override bool IsReadOnly { get { throw null; } }
public override System.Type PropertyType { get { throw null; } }
protected TypeDescriptionProvider(System.ComponentModel.TypeDescriptionProvider parent) { }
public virtual object CreateInstance(System.IServiceProvider provider, System.Type objectType, System.Type[] argTypes, object[] args) { throw null; }
public virtual System.Collections.IDictionary GetCache(object instance) { throw null; }
+ [System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("The Type of instance cannot be statically discovered.")]
public virtual System.ComponentModel.ICustomTypeDescriptor GetExtendedTypeDescriptor(object instance) { throw null; }
protected internal virtual System.ComponentModel.IExtenderProvider[] GetExtenderProviders(object instance) { throw null; }
+ [System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("The Type of component cannot be statically discovered.")]
public virtual string GetFullComponentName(object component) { throw null; }
+ [System.Diagnostics.CodeAnalysis.RequiresUnreferencedCodeAttribute("GetReflectionType is not trim compatible because the Type of object cannot be statically discovered.")]
public System.Type GetReflectionType(object instance) { throw null; }
- public System.Type GetReflectionType(System.Type objectType) { throw null; }
- public virtual System.Type GetReflectionType(System.Type objectType, object instance) { throw null; }
+ [return: System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembersAttribute(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.PublicFields | System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.PublicParameterlessConstructor)]
+ public System.Type GetReflectionType([System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembersAttribute(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.PublicFields | System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.PublicParameterlessConstructor)] System.Type objectType) { throw null; }
+ [return: System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembersAttribute(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.PublicFields | System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.PublicParameterlessConstructor)]
+ public virtual System.Type GetReflectionType([System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembersAttribute(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.PublicFields | System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.PublicParameterlessConstructor)] System.Type objectType, object instance) { throw null; }
public virtual System.Type GetRuntimeType(System.Type reflectionType) { throw null; }
+ [System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("The Type of instance cannot be statically discovered.")]
public System.ComponentModel.ICustomTypeDescriptor GetTypeDescriptor(object instance) { throw null; }
- public System.ComponentModel.ICustomTypeDescriptor GetTypeDescriptor(System.Type objectType) { throw null; }
- public virtual System.ComponentModel.ICustomTypeDescriptor GetTypeDescriptor(System.Type objectType, object instance) { throw null; }
+ public System.ComponentModel.ICustomTypeDescriptor GetTypeDescriptor([System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembers(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.All)] System.Type objectType) { throw null; }
+ public virtual System.ComponentModel.ICustomTypeDescriptor GetTypeDescriptor([System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembers(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.All)] System.Type objectType, object instance) { throw null; }
public virtual bool IsSupportedType(System.Type type) { throw null; }
}
public sealed partial class TypeDescriptor
public static void AddProviderTransparent(System.ComponentModel.TypeDescriptionProvider provider, System.Type type) { }
[System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)]
public static void CreateAssociation(object primary, object secondary) { }
+ [System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("The Type of component cannot be statically discovered.")]
public static System.ComponentModel.Design.IDesigner CreateDesigner(System.ComponentModel.IComponent component, System.Type designerBaseType) { throw null; }
public static System.ComponentModel.EventDescriptor CreateEvent(System.Type componentType, System.ComponentModel.EventDescriptor oldEventDescriptor, params System.Attribute[] attributes) { throw null; }
public static System.ComponentModel.EventDescriptor CreateEvent(System.Type componentType, string name, System.Type type, params System.Attribute[] attributes) { throw null; }
public static object CreateInstance(System.IServiceProvider provider, System.Type objectType, System.Type[] argTypes, object[] args) { throw null; }
- public static System.ComponentModel.PropertyDescriptor CreateProperty(System.Type componentType, System.ComponentModel.PropertyDescriptor oldPropertyDescriptor, params System.Attribute[] attributes) { throw null; }
- public static System.ComponentModel.PropertyDescriptor CreateProperty(System.Type componentType, string name, System.Type type, params System.Attribute[] attributes) { throw null; }
+ public static System.ComponentModel.PropertyDescriptor CreateProperty([System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembers(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.All)] System.Type componentType, System.ComponentModel.PropertyDescriptor oldPropertyDescriptor, params System.Attribute[] attributes) { throw null; }
+ public static System.ComponentModel.PropertyDescriptor CreateProperty([System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembers(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.All)] System.Type componentType, string name, System.Type type, params System.Attribute[] attributes) { throw null; }
[System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)]
public static object GetAssociation(System.Type type, object primary) { throw null; }
+ [System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("The Type of component cannot be statically discovered.")]
public static System.ComponentModel.AttributeCollection GetAttributes(object component) { throw null; }
[System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)]
+ [System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("The Type of component cannot be statically discovered.")]
public static System.ComponentModel.AttributeCollection GetAttributes(object component, bool noCustomTypeDesc) { throw null; }
- public static System.ComponentModel.AttributeCollection GetAttributes(System.Type componentType) { throw null; }
+ public static System.ComponentModel.AttributeCollection GetAttributes([System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembers(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.All)] System.Type componentType) { throw null; }
+ [System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("The Type of component cannot be statically discovered.")]
public static string GetClassName(object component) { throw null; }
[System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)]
+ [System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("The Type of component cannot be statically discovered.")]
public static string GetClassName(object component, bool noCustomTypeDesc) { throw null; }
- public static string GetClassName(System.Type componentType) { throw null; }
+ public static string GetClassName([System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembers(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.All)] System.Type componentType) { throw null; }
+ [System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("The Type of component cannot be statically discovered.")]
public static string GetComponentName(object component) { throw null; }
[System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)]
+ [System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("The Type of component cannot be statically discovered.")]
public static string GetComponentName(object component, bool noCustomTypeDesc) { throw null; }
+ [System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("The Type of component cannot be statically discovered.")]
public static System.ComponentModel.TypeConverter GetConverter(object component) { throw null; }
[System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)]
+ [System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("The Type of component cannot be statically discovered.")]
public static System.ComponentModel.TypeConverter GetConverter(object component, bool noCustomTypeDesc) { throw null; }
- public static System.ComponentModel.TypeConverter GetConverter(System.Type type) { throw null; }
+ public static System.ComponentModel.TypeConverter GetConverter([System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembers(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.All)] System.Type type) { throw null; }
+ [System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("The Type of component cannot be statically discovered.")]
public static System.ComponentModel.EventDescriptor GetDefaultEvent(object component) { throw null; }
[System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)]
+ [System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("The Type of component cannot be statically discovered.")]
public static System.ComponentModel.EventDescriptor GetDefaultEvent(object component, bool noCustomTypeDesc) { throw null; }
- public static System.ComponentModel.EventDescriptor GetDefaultEvent(System.Type componentType) { throw null; }
+ public static System.ComponentModel.EventDescriptor GetDefaultEvent([System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembers(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.All)] System.Type componentType) { throw null; }
+ [System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("The Type of component cannot be statically discovered.")]
public static System.ComponentModel.PropertyDescriptor GetDefaultProperty(object component) { throw null; }
[System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)]
+ [System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("The Type of component cannot be statically discovered.")]
public static System.ComponentModel.PropertyDescriptor GetDefaultProperty(object component, bool noCustomTypeDesc) { throw null; }
- public static System.ComponentModel.PropertyDescriptor GetDefaultProperty(System.Type componentType) { throw null; }
+ public static System.ComponentModel.PropertyDescriptor GetDefaultProperty([System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembers(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.All)] System.Type componentType) { throw null; }
+ [System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("The Type of component cannot be statically discovered.")]
public static object GetEditor(object component, System.Type editorBaseType) { throw null; }
[System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)]
+ [System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("The Type of component cannot be statically discovered.")]
public static object GetEditor(object component, System.Type editorBaseType, bool noCustomTypeDesc) { throw null; }
- public static object GetEditor(System.Type type, System.Type editorBaseType) { throw null; }
+ public static object GetEditor([System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembers(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.All)] System.Type type, System.Type editorBaseType) { throw null; }
+ [System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("The Type of component cannot be statically discovered.")]
public static System.ComponentModel.EventDescriptorCollection GetEvents(object component) { throw null; }
+ [System.Diagnostics.CodeAnalysis.RequiresUnreferencedCodeAttribute("The Type of component cannot be statically discovered. The public parameterless constructor or the 'Default' static field may be trimmed from the Attribute's Type.")]
public static System.ComponentModel.EventDescriptorCollection GetEvents(object component, System.Attribute[] attributes) { throw null; }
[System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)]
+ [System.Diagnostics.CodeAnalysis.RequiresUnreferencedCodeAttribute("The Type of component cannot be statically discovered. The public parameterless constructor or the 'Default' static field may be trimmed from the Attribute's Type.")]
public static System.ComponentModel.EventDescriptorCollection GetEvents(object component, System.Attribute[] attributes, bool noCustomTypeDesc) { throw null; }
[System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)]
+ [System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("The Type of component cannot be statically discovered.")]
public static System.ComponentModel.EventDescriptorCollection GetEvents(object component, bool noCustomTypeDesc) { throw null; }
- public static System.ComponentModel.EventDescriptorCollection GetEvents(System.Type componentType) { throw null; }
- public static System.ComponentModel.EventDescriptorCollection GetEvents(System.Type componentType, System.Attribute[] attributes) { throw null; }
+ public static System.ComponentModel.EventDescriptorCollection GetEvents([System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembers(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.All)] System.Type componentType) { throw null; }
+ [System.Diagnostics.CodeAnalysis.RequiresUnreferencedCodeAttribute("The public parameterless constructor or the 'Default' static field may be trimmed from the Attribute's Type.")]
+ public static System.ComponentModel.EventDescriptorCollection GetEvents([System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembers(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.All)] System.Type componentType, System.Attribute[] attributes) { throw null; }
+ [System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("The Type of component cannot be statically discovered.")]
public static string GetFullComponentName(object component) { throw null; }
+ [System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("The Type of component cannot be statically discovered.")]
public static System.ComponentModel.PropertyDescriptorCollection GetProperties(object component) { throw null; }
+ [System.Diagnostics.CodeAnalysis.RequiresUnreferencedCodeAttribute("The Type of component cannot be statically discovered. The public parameterless constructor or the 'Default' static field may be trimmed from the Attribute's Type.")]
public static System.ComponentModel.PropertyDescriptorCollection GetProperties(object component, System.Attribute[] attributes) { throw null; }
+ [System.Diagnostics.CodeAnalysis.RequiresUnreferencedCodeAttribute("The Type of component cannot be statically discovered. The public parameterless constructor or the 'Default' static field may be trimmed from the Attribute's Type.")]
public static System.ComponentModel.PropertyDescriptorCollection GetProperties(object component, System.Attribute[] attributes, bool noCustomTypeDesc) { throw null; }
[System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)]
+ [System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("The Type of component cannot be statically discovered.")]
public static System.ComponentModel.PropertyDescriptorCollection GetProperties(object component, bool noCustomTypeDesc) { throw null; }
- public static System.ComponentModel.PropertyDescriptorCollection GetProperties(System.Type componentType) { throw null; }
- public static System.ComponentModel.PropertyDescriptorCollection GetProperties(System.Type componentType, System.Attribute[] attributes) { throw null; }
+ public static System.ComponentModel.PropertyDescriptorCollection GetProperties([System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembers(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.All)] System.Type componentType) { throw null; }
+ [System.Diagnostics.CodeAnalysis.RequiresUnreferencedCodeAttribute("The public parameterless constructor or the 'Default' static field may be trimmed from the Attribute's Type.")]
+ public static System.ComponentModel.PropertyDescriptorCollection GetProperties([System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembers(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.All)] System.Type componentType, System.Attribute[] attributes) { throw null; }
[System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)]
public static System.ComponentModel.TypeDescriptionProvider GetProvider(object instance) { throw null; }
[System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)]
public static System.ComponentModel.TypeDescriptionProvider GetProvider(System.Type type) { throw null; }
[System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)]
+ [System.Diagnostics.CodeAnalysis.RequiresUnreferencedCodeAttribute("GetReflectionType is not trim compatible because the Type of object cannot be statically discovered.")]
public static System.Type GetReflectionType(object instance) { throw null; }
[System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)]
- public static System.Type GetReflectionType(System.Type type) { throw null; }
+ [return: System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembersAttribute(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.PublicFields | System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.PublicParameterlessConstructor)]
+ public static System.Type GetReflectionType([System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembersAttribute(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.PublicFields | System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.PublicParameterlessConstructor)] System.Type type) { throw null; }
public static void Refresh(object component) { }
public static void Refresh(System.Reflection.Assembly assembly) { }
public static void Refresh(System.Reflection.Module module) { }
protected System.ComponentModel.Design.DesignerOptionService.DesignerOptionCollection CreateOptionCollection(System.ComponentModel.Design.DesignerOptionService.DesignerOptionCollection parent, string name, object value) { throw null; }
protected virtual void PopulateOptionCollection(System.ComponentModel.Design.DesignerOptionService.DesignerOptionCollection options) { }
protected virtual bool ShowDialog(System.ComponentModel.Design.DesignerOptionService.DesignerOptionCollection options, object optionObject) { throw null; }
+ [System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("The option value's Type cannot be statically discovered.")]
object System.ComponentModel.Design.IDesignerOptionService.GetOptionValue(string pageName, string valueName) { throw null; }
+ [System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("The option value's Type cannot be statically discovered.")]
void System.ComponentModel.Design.IDesignerOptionService.SetOptionValue(string pageName, string valueName, object value) { }
[System.ComponentModel.EditorAttribute("", "System.Drawing.Design.UITypeEditor, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a")]
public sealed partial class DesignerOptionCollection : System.Collections.ICollection, System.Collections.IEnumerable, System.Collections.IList
public System.ComponentModel.Design.DesignerOptionService.DesignerOptionCollection this[string name] { get { throw null; } }
public string Name { get { throw null; } }
public System.ComponentModel.Design.DesignerOptionService.DesignerOptionCollection Parent { get { throw null; } }
- public System.ComponentModel.PropertyDescriptorCollection Properties { get { throw null; } }
+ public System.ComponentModel.PropertyDescriptorCollection Properties { [System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("The Type of DesignerOptionCollection's value cannot be statically discovered.")] get { throw null; } }
bool System.Collections.ICollection.IsSynchronized { get { throw null; } }
object System.Collections.ICollection.SyncRoot { get { throw null; } }
bool System.Collections.IList.IsFixedSize { get { throw null; } }
}
public partial interface IDesignerOptionService
{
+ [System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("The option value's Type cannot be statically discovered.")]
object GetOptionValue(string pageName, string valueName);
+ [System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("The option value's Type cannot be statically discovered.")]
void SetOptionValue(string pageName, string valueName, object value);
}
public partial interface IDictionaryService
public override object ConvertTo(System.ComponentModel.ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value, System.Type destinationType) { throw null; }
public override object CreateInstance(System.ComponentModel.ITypeDescriptorContext context, System.Collections.IDictionary propertyValues) { throw null; }
public override bool GetCreateInstanceSupported(System.ComponentModel.ITypeDescriptorContext context) { throw null; }
+ [System.Diagnostics.CodeAnalysis.RequiresUnreferencedCodeAttribute("The Type of value cannot be statically discovered. The public parameterless constructor or the 'Default' static field may be trimmed from the Attribute's Type.")]
public override System.ComponentModel.PropertyDescriptorCollection GetProperties(System.ComponentModel.ITypeDescriptorContext context, object value, System.Attribute[] attributes) { throw null; }
public override bool GetPropertiesSupported(System.ComponentModel.ITypeDescriptorContext context) { throw null; }
}
public override object ConvertTo(System.ComponentModel.ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value, System.Type destinationType) { throw null; }
public override object CreateInstance(System.ComponentModel.ITypeDescriptorContext context, System.Collections.IDictionary propertyValues) { throw null; }
public override bool GetCreateInstanceSupported(System.ComponentModel.ITypeDescriptorContext context) { throw null; }
+ [System.Diagnostics.CodeAnalysis.RequiresUnreferencedCodeAttribute("The Type of value cannot be statically discovered. The public parameterless constructor or the 'Default' static field may be trimmed from the Attribute's Type.")]
public override System.ComponentModel.PropertyDescriptorCollection GetProperties(System.ComponentModel.ITypeDescriptorContext context, object value, System.Attribute[] attributes) { throw null; }
public override bool GetPropertiesSupported(System.ComponentModel.ITypeDescriptorContext context) { throw null; }
}
public override object ConvertTo(System.ComponentModel.ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value, System.Type destinationType) { throw null; }
public override object CreateInstance(System.ComponentModel.ITypeDescriptorContext context, System.Collections.IDictionary propertyValues) { throw null; }
public override bool GetCreateInstanceSupported(System.ComponentModel.ITypeDescriptorContext context) { throw null; }
+ [System.Diagnostics.CodeAnalysis.RequiresUnreferencedCodeAttribute("The Type of value cannot be statically discovered. The public parameterless constructor or the 'Default' static field may be trimmed from the Attribute's Type.")]
public override System.ComponentModel.PropertyDescriptorCollection GetProperties(System.ComponentModel.ITypeDescriptorContext context, object value, System.Attribute[] attributes) { throw null; }
public override bool GetPropertiesSupported(System.ComponentModel.ITypeDescriptorContext context) { throw null; }
}
public override object ConvertTo(System.ComponentModel.ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value, System.Type destinationType) { throw null; }
public override object CreateInstance(System.ComponentModel.ITypeDescriptorContext context, System.Collections.IDictionary propertyValues) { throw null; }
public override bool GetCreateInstanceSupported(System.ComponentModel.ITypeDescriptorContext context) { throw null; }
+ [System.Diagnostics.CodeAnalysis.RequiresUnreferencedCodeAttribute("The Type of value cannot be statically discovered. The public parameterless constructor or the 'Default' static field may be trimmed from the Attribute's Type.")]
public override System.ComponentModel.PropertyDescriptorCollection GetProperties(System.ComponentModel.ITypeDescriptorContext context, object value, System.Attribute[] attributes) { throw null; }
public override bool GetPropertiesSupported(System.ComponentModel.ITypeDescriptorContext context) { throw null; }
}
</attribute>
<attribute fullname="System.Diagnostics.CodeAnalysis.UnconditionalSuppressMessageAttribute">
<argument>ILLink</argument>
- <argument>IL2070</argument>
- <property name="Scope">member</property>
- <property name="Target">M:System.ComponentModel.ReflectTypeDescriptionProvider.ReflectGetEvents(System.Type)</property>
- </attribute>
- <attribute fullname="System.Diagnostics.CodeAnalysis.UnconditionalSuppressMessageAttribute">
- <argument>ILLink</argument>
- <argument>IL2070</argument>
- <property name="Scope">member</property>
- <property name="Target">M:System.ComponentModel.ReflectTypeDescriptionProvider.ReflectGetProperties(System.Type)</property>
- </attribute>
- <attribute fullname="System.Diagnostics.CodeAnalysis.UnconditionalSuppressMessageAttribute">
- <argument>ILLink</argument>
<argument>IL2072</argument>
<property name="Scope">member</property>
<property name="Target">M:System.ComponentModel.LicenseManager.ValidateInternalRecursive(System.ComponentModel.LicenseContext,System.Type,System.Object,System.Boolean,System.ComponentModel.License@,System.String@)</property>
</attribute>
<attribute fullname="System.Diagnostics.CodeAnalysis.UnconditionalSuppressMessageAttribute">
<argument>ILLink</argument>
- <argument>IL2072</argument>
- <property name="Scope">member</property>
- <property name="Target">M:System.ComponentModel.TypeDescriptor.CreateDesigner(System.ComponentModel.IComponent,System.Type)</property>
- </attribute>
- <attribute fullname="System.Diagnostics.CodeAnalysis.UnconditionalSuppressMessageAttribute">
- <argument>ILLink</argument>
<argument>IL2075</argument>
<property name="Scope">member</property>
- <property name="Target">M:System.ComponentModel.AttributeCollection.GetDefaultAttribute(System.Type)</property>
+ <property name="Target">M:System.ComponentModel.NullableConverter.ConvertTo(System.ComponentModel.ITypeDescriptorContext,System.Globalization.CultureInfo,System.Object,System.Type)</property>
</attribute>
<attribute fullname="System.Diagnostics.CodeAnalysis.UnconditionalSuppressMessageAttribute">
<argument>ILLink</argument>
<argument>IL2075</argument>
<property name="Scope">member</property>
- <property name="Target">M:System.ComponentModel.ComponentResourceManager.ApplyResources(System.Object,System.String,System.Globalization.CultureInfo)</property>
+ <property name="Target">M:System.ComponentModel.ReflectEventDescriptor.FillEventInfoAttribute(System.Reflection.EventInfo,System.Collections.IList)</property>
</attribute>
<attribute fullname="System.Diagnostics.CodeAnalysis.UnconditionalSuppressMessageAttribute">
<argument>ILLink</argument>
<argument>IL2075</argument>
<property name="Scope">member</property>
- <property name="Target">M:System.ComponentModel.EnumConverter.ConvertTo(System.ComponentModel.ITypeDescriptorContext,System.Globalization.CultureInfo,System.Object,System.Type)</property>
+ <property name="Target">M:System.ComponentModel.ReflectEventDescriptor.FillMethods</property>
</attribute>
<attribute fullname="System.Diagnostics.CodeAnalysis.UnconditionalSuppressMessageAttribute">
<argument>ILLink</argument>
<argument>IL2075</argument>
<property name="Scope">member</property>
- <property name="Target">M:System.ComponentModel.EnumConverter.GetStandardValues(System.ComponentModel.ITypeDescriptorContext)</property>
+ <property name="Target">M:System.ComponentModel.ReflectEventDescriptor.FillSingleMethodAttribute(System.Reflection.MethodInfo,System.Collections.IList)</property>
</attribute>
<attribute fullname="System.Diagnostics.CodeAnalysis.UnconditionalSuppressMessageAttribute">
<argument>ILLink</argument>
<argument>IL2075</argument>
<property name="Scope">member</property>
- <property name="Target">M:System.ComponentModel.NullableConverter.ConvertTo(System.ComponentModel.ITypeDescriptorContext,System.Globalization.CultureInfo,System.Object,System.Type)</property>
+ <property name="Target">M:System.ComponentModel.ReflectPropertyDescriptor.FillAttributes(System.Collections.IList)</property>
</attribute>
<attribute fullname="System.Diagnostics.CodeAnalysis.UnconditionalSuppressMessageAttribute">
<argument>ILLink</argument>
<argument>IL2075</argument>
<property name="Scope">member</property>
- <property name="Target">M:System.ComponentModel.ReflectEventDescriptor.FillEventInfoAttribute(System.Reflection.EventInfo,System.Collections.IList)</property>
+ <property name="Target">M:System.ComponentModel.ReflectPropertyDescriptor.get_SetMethodValue</property>
</attribute>
<attribute fullname="System.Diagnostics.CodeAnalysis.UnconditionalSuppressMessageAttribute">
<argument>ILLink</argument>
<argument>IL2075</argument>
<property name="Scope">member</property>
- <property name="Target">M:System.ComponentModel.ReflectEventDescriptor.FillMethods</property>
+ <property name="Target">M:System.ComponentModel.ReflectTypeDescriptionProvider.GetIntrinsicTypeEditor(System.Collections.Hashtable,System.Type)</property>
</attribute>
<attribute fullname="System.Diagnostics.CodeAnalysis.UnconditionalSuppressMessageAttribute">
<argument>ILLink</argument>
- <argument>IL2075</argument>
+ <argument>IL2080</argument>
<property name="Scope">member</property>
- <property name="Target">M:System.ComponentModel.ReflectEventDescriptor.FillSingleMethodAttribute(System.Reflection.MethodInfo,System.Collections.IList)</property>
+ <property name="Target">M:System.ComponentModel.ReflectEventDescriptor.FillMethods</property>
</attribute>
<attribute fullname="System.Diagnostics.CodeAnalysis.UnconditionalSuppressMessageAttribute">
<argument>ILLink</argument>
- <argument>IL2075</argument>
+ <argument>IL2080</argument>
<property name="Scope">member</property>
<property name="Target">M:System.ComponentModel.ReflectPropertyDescriptor.FillAttributes(System.Collections.IList)</property>
</attribute>
<attribute fullname="System.Diagnostics.CodeAnalysis.UnconditionalSuppressMessageAttribute">
<argument>ILLink</argument>
- <argument>IL2075</argument>
+ <argument>IL2080</argument>
<property name="Scope">member</property>
<property name="Target">M:System.ComponentModel.ReflectPropertyDescriptor.get_SetMethodValue</property>
</attribute>
<attribute fullname="System.Diagnostics.CodeAnalysis.UnconditionalSuppressMessageAttribute">
<argument>ILLink</argument>
- <argument>IL2075</argument>
- <property name="Scope">member</property>
- <property name="Target">M:System.ComponentModel.ReflectTypeDescriptionProvider.GetIntrinsicTypeEditor(System.Collections.Hashtable,System.Type)</property>
- </attribute>
- <attribute fullname="System.Diagnostics.CodeAnalysis.UnconditionalSuppressMessageAttribute">
- <argument>ILLink</argument>
- <argument>IL2075</argument>
+ <argument>IL2026</argument>
<property name="Scope">member</property>
- <property name="Target">M:System.ComponentModel.ReflectTypeDescriptionProvider.ReflectGetExtendedProperties(System.ComponentModel.IExtenderProvider)</property>
+ <property name="Target">M:System.ComponentModel.Design.DesigntimeLicenseContextSerializer.Deserialize(System.IO.Stream,System.String,System.ComponentModel.Design.RuntimeLicenseContext)</property>
</attribute>
<attribute fullname="System.Diagnostics.CodeAnalysis.UnconditionalSuppressMessageAttribute">
<argument>ILLink</argument>
- <argument>IL2080</argument>
+ <argument>IL2026</argument>
<property name="Scope">member</property>
- <property name="Target">M:System.ComponentModel.ReflectEventDescriptor.FillMethods</property>
+ <property name="Target">M:System.ComponentModel.Design.DesigntimeLicenseContextSerializer.Serialize(System.IO.Stream,System.String,System.ComponentModel.Design.DesigntimeLicenseContext)</property>
</attribute>
<attribute fullname="System.Diagnostics.CodeAnalysis.UnconditionalSuppressMessageAttribute">
<argument>ILLink</argument>
- <argument>IL2080</argument>
+ <argument>IL2026</argument>
<property name="Scope">member</property>
- <property name="Target">M:System.ComponentModel.ReflectPropertyDescriptor.FillAttributes(System.Collections.IList)</property>
+ <property name="Target">M:System.ComponentModel.TypeDescriptor.TypeDescriptionNode.DefaultTypeDescriptor.System#ComponentModel#ICustomTypeDescriptor#GetConverter</property>
</attribute>
<attribute fullname="System.Diagnostics.CodeAnalysis.UnconditionalSuppressMessageAttribute">
<argument>ILLink</argument>
- <argument>IL2080</argument>
+ <argument>IL2026</argument>
<property name="Scope">member</property>
- <property name="Target">M:System.ComponentModel.ReflectPropertyDescriptor.get_GetMethodValue</property>
+ <property name="Target">M:System.ComponentModel.TypeDescriptor.TypeDescriptionNode.DefaultTypeDescriptor.System#ComponentModel#ICustomTypeDescriptor#GetDefaultEvent</property>
</attribute>
<attribute fullname="System.Diagnostics.CodeAnalysis.UnconditionalSuppressMessageAttribute">
<argument>ILLink</argument>
- <argument>IL2080</argument>
+ <argument>IL2026</argument>
<property name="Scope">member</property>
- <property name="Target">M:System.ComponentModel.ReflectPropertyDescriptor.get_SetMethodValue</property>
+ <property name="Target">M:System.ComponentModel.TypeDescriptor.TypeDescriptionNode.DefaultTypeDescriptor.System#ComponentModel#ICustomTypeDescriptor#GetDefaultProperty</property>
</attribute>
<attribute fullname="System.Diagnostics.CodeAnalysis.UnconditionalSuppressMessageAttribute">
<argument>ILLink</argument>
- <argument>IL2087</argument>
+ <argument>IL2026</argument>
<property name="Scope">member</property>
- <property name="Target">M:System.ComponentModel.BindingList`1.AddNewCore</property>
+ <property name="Target">M:System.ComponentModel.TypeDescriptor.TypeDescriptionNode.DefaultTypeDescriptor.System#ComponentModel#ICustomTypeDescriptor#GetEditor(System.Type)</property>
</attribute>
<attribute fullname="System.Diagnostics.CodeAnalysis.UnconditionalSuppressMessageAttribute">
<argument>ILLink</argument>
- <argument>IL2090</argument>
+ <argument>IL2062</argument>
<property name="Scope">member</property>
- <property name="Target">M:System.ComponentModel.BindingList`1.get_ItemTypeHasDefaultConstructor</property>
+ <property name="Target">M:System.ComponentModel.ReflectTypeDescriptionProvider.ReflectedTypeData.GetAttributes</property>
</attribute>
<attribute fullname="System.Diagnostics.CodeAnalysis.UnconditionalSuppressMessageAttribute">
<argument>ILLink</argument>
- <argument>IL2026</argument>
+ <argument>IL2072</argument>
<property name="Scope">member</property>
- <property name="Target">M:System.ComponentModel.Design.DesigntimeLicenseContextSerializer.Deserialize(System.IO.Stream,System.String,System.ComponentModel.Design.RuntimeLicenseContext)</property>
+ <property name="Target">M:System.ComponentModel.NullableConverter.#ctor(System.Type)</property>
</attribute>
<attribute fullname="System.Diagnostics.CodeAnalysis.UnconditionalSuppressMessageAttribute">
<argument>ILLink</argument>
- <argument>IL2026</argument>
+ <argument>IL2072</argument>
<property name="Scope">member</property>
- <property name="Target">M:System.ComponentModel.Design.DesigntimeLicenseContextSerializer.Serialize(System.IO.Stream,System.String,System.ComponentModel.Design.DesigntimeLicenseContext)</property>
+ <property name="Target">M:System.ComponentModel.ReflectPropertyDescriptor.FillAttributes(System.Collections.IList)</property>
</attribute>
</assembly>
</linker>
using System.Collections;
using System.Collections.Generic;
using System.ComponentModel;
+using System.Diagnostics.CodeAnalysis;
using System.Linq;
using System.Xml.Linq;
{
}
- public override ICustomTypeDescriptor GetTypeDescriptor(Type type, object instance)
+ public override ICustomTypeDescriptor GetTypeDescriptor([DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] Type type, object instance)
{
return new XTypeDescriptor<T>(base.GetTypeDescriptor(type, instance));
}
{
}
+ [UnconditionalSuppressMessage("ReflectionAnalysis", "IL2026:RequiresUnreferencedCode",
+ Justification = "No attributes are supplied.")]
public override PropertyDescriptorCollection GetProperties()
{
return GetProperties(null);
}
+ [RequiresUnreferencedCode(AttributeCollection.FilterRequiresUnreferencedCodeMessage)]
public override PropertyDescriptorCollection GetProperties(Attribute[] attributes)
{
PropertyDescriptorCollection properties = new PropertyDescriptorCollection(null);
/// specified value to the specified type, and using the U.S. English culture as the
/// translation context.
/// </summary>
- public AmbientValueAttribute(Type type, string value)
+ public AmbientValueAttribute([DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] Type type, string value)
{
// The try/catch here is because attributes should never throw exceptions. We would fail to
// load an otherwise normal class.
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
+using System.Diagnostics.CodeAnalysis;
using System.Globalization;
namespace System.ComponentModel
/// <summary>
/// Gets a collection of properties for the type of array specified by the value parameter.
/// </summary>
+ [RequiresUnreferencedCode("The Type of value cannot be statically discovered. " + AttributeCollection.FilterRequiresUnreferencedCodeMessage)]
public override PropertyDescriptorCollection GetProperties(ITypeDescriptorContext context, object value, Attribute[] attributes)
{
if (value == null)
using System.Reflection;
using System.Collections;
+using System.Diagnostics.CodeAnalysis;
namespace System.ComponentModel
{
/// </summary>
public class AttributeCollection : ICollection, IEnumerable
{
+ internal const string FilterRequiresUnreferencedCodeMessage = "The public parameterless constructor or the 'Default' static field may be trimmed from the Attribute's Type.";
+
/// <summary>
/// An empty AttributeCollection that can used instead of creating a new one.
/// </summary>
/// <summary>
/// Gets the attribute with the specified type.
/// </summary>
- public virtual Attribute this[Type attributeType]
+ public virtual Attribute this[[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicParameterlessConstructor | DynamicallyAccessedMemberTypes.PublicFields)] Type attributeType]
{
get
{
/// <summary>
/// Determines if this collection of attributes has the specified attribute.
/// </summary>
+ [RequiresUnreferencedCode(FilterRequiresUnreferencedCodeMessage)]
public bool Contains(Attribute attribute)
{
if (attribute == null)
/// Determines if this attribute collection contains the all
/// the specified attributes in the attribute array.
/// </summary>
+ [RequiresUnreferencedCode(FilterRequiresUnreferencedCodeMessage)]
public bool Contains(Attribute[] attributes)
{
if (attributes == null)
/// Returns the default value for an attribute. This uses the following heuristic:
/// 1. It looks for a public static field named "Default".
/// </summary>
- protected Attribute GetDefaultAttribute(Type attributeType)
+ protected Attribute GetDefaultAttribute([DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicParameterlessConstructor | DynamicallyAccessedMemberTypes.PublicFields)] Type attributeType)
{
if (attributeType == null)
{
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
-using System.Reflection;
-using System.Collections.ObjectModel;
using System.Collections.Generic;
+using System.Collections.ObjectModel;
using System.Diagnostics;
using System.Diagnostics.CodeAnalysis;
+using System.Reflection;
using System.Runtime.CompilerServices;
namespace System.ComponentModel
{
[Serializable]
[TypeForwardedFrom("System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089")]
- public class BindingList<T> : Collection<T>, IBindingList, ICancelAddNew, IRaiseItemChangedEvents
+ public class BindingList<[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] T> :
+ Collection<T>, IBindingList, ICancelAddNew, IRaiseItemChangedEvents
{
private int addNewPos = -1; // Do not rename (binary serialization)
private bool raiseListChangedEvents = true; // Do not rename (binary serialization)
// The .NET Foundation licenses this file to you under the MIT license.
using System.Collections;
+using System.Diagnostics.CodeAnalysis;
using System.Globalization;
namespace System.ComponentModel
/// Gets a collection of properties for the type of array specified by the value
/// parameter using the specified context and attributes.
/// </summary>
+ [RequiresUnreferencedCode("The Type of value cannot be statically discovered. " + AttributeCollection.FilterRequiresUnreferencedCodeMessage)]
public override PropertyDescriptorCollection GetProperties(ITypeDescriptorContext context, object value, Attribute[] attributes)
{
return new PropertyDescriptorCollection(null);
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
+using System.Diagnostics.CodeAnalysis;
+
namespace System.ComponentModel
{
/// <summary>
/// Gets a collection of properties for the type of component
/// specified by the value parameter.
/// </summary>
+ [RequiresUnreferencedCode("The Type of value cannot be statically discovered. " + AttributeCollection.FilterRequiresUnreferencedCodeMessage)]
public override PropertyDescriptorCollection GetProperties(ITypeDescriptorContext context, object value, Attribute[] attributes)
{
return TypeDescriptor.GetProperties(value, attributes);
using System.Collections;
using System.Collections.Generic;
+using System.Diagnostics.CodeAnalysis;
using System.Globalization;
using System.Reflection;
using System.Resources;
/// to the corresponding property on the object. If there is no matching
/// property the resource will be ignored.
/// </summary>
+ [RequiresUnreferencedCode("The Type of value cannot be statically discovered.")]
public void ApplyResources(object value, string objectName) => ApplyResources(value, objectName, null);
/// <summary>
/// to the corresponding property on the object. If there is no matching
/// property the resource will be ignored.
/// </summary>
+ [RequiresUnreferencedCode("The Type of value cannot be statically discovered.")]
public virtual void ApplyResources(object value, string objectName, CultureInfo culture)
{
if (value == null)
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
+using System.Diagnostics.CodeAnalysis;
+
namespace System.ComponentModel
{
/// <summary>
/// Adds the specified component to the <see cref='System.ComponentModel.Container'/>
/// The component is unnamed.
/// </summary>
+ [UnconditionalSuppressMessage("ReflectionAnalysis", "IL2026:RequiresUnreferencedCode", Justification = "No name is provided.")]
public virtual void Add(IComponent component) => Add(component, null);
// Adds a component to the container.
/// Adds the specified component to the <see cref='System.ComponentModel.Container'/> and assigns
/// a name to it.
/// </summary>
+ [RequiresUnreferencedCode("The Type of components in the container cannot be statically discovered to validate the name.")]
public virtual void Add(IComponent component, string name)
{
lock (_syncObj)
/// verifies that name is either null or unique compared to the names of other
/// components in the container.
/// </summary>
+ [RequiresUnreferencedCode("The Type of components in the container cannot be statically discovered.")]
protected virtual void ValidateName(IComponent component, string name)
{
if (component == null)
public string Name
{
get => _name;
+ [RequiresUnreferencedCode("The Type of components in the container cannot be statically discovered to validate the name.")]
set
{
if (value == null || _name == null || !value.Equals(_name))
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
+using System.Diagnostics.CodeAnalysis;
+
namespace System.ComponentModel
{
public abstract class CustomTypeDescriptor : ICustomTypeDescriptor
/// returned. If no parent is provided,this will return an empty
/// event collection.
/// </summary>
+ [RequiresUnreferencedCode(AttributeCollection.FilterRequiresUnreferencedCodeMessage)]
public virtual EventDescriptorCollection GetEvents(Attribute[] attributes)
{
if (_parent != null)
/// If no parent is provided,this will return an empty
/// property collection.
/// </summary>
+ [RequiresUnreferencedCode(AttributeCollection.FilterRequiresUnreferencedCodeMessage)]
public virtual PropertyDescriptorCollection GetProperties(Attribute[] attributes)
{
if (_parent != null)
// The .NET Foundation licenses this file to you under the MIT license.
using System.Collections;
+using System.Diagnostics.CodeAnalysis;
namespace System.ComponentModel
{
/// If not overridden, the default implementation of this method will call
/// GetTypeDescriptor.GetComponentName.
/// </summary>
+ [RequiresUnreferencedCode("The Type of component cannot be statically discovered.")]
public override string GetFullComponentName(object component) => Provider.GetFullComponentName(component);
/// <summary>
/// model only supports extended properties this API can be used for extended
/// attributes and events as well, if the type description provider supports it.
/// </summary>
+ [RequiresUnreferencedCode("The Type of instance cannot be statically discovered.")]
public override ICustomTypeDescriptor GetExtendedTypeDescriptor(object instance)
{
return Provider.GetExtendedTypeDescriptor(instance);
/// If no custom type descriptor can be located for an object, GetReflection
/// is called to perform normal reflection against the object.
/// </summary>
- public override Type GetReflectionType(Type objectType, object instance)
+ [return: DynamicallyAccessedMembers(TypeDescriptor.ReflectTypesDynamicallyAccessedMembers)]
+ public override Type GetReflectionType(
+ [DynamicallyAccessedMembers(TypeDescriptor.ReflectTypesDynamicallyAccessedMembers)] Type objectType,
+ object instance)
{
return Provider.GetReflectionType(objectType, instance);
}
/// interested in providing type information for the object it should
/// return null.
/// </summary>
- public override ICustomTypeDescriptor GetTypeDescriptor(Type objectType, object instance)
+ public override ICustomTypeDescriptor GetTypeDescriptor([DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] Type objectType, object instance)
{
return Provider.GetTypeDescriptor(objectType, instance);
}
/// Retrieves the property descriptor for the given page / value name. Returns
/// null if the property couldn't be found.
/// </summary>
+ [RequiresUnreferencedCode("The Type of DesignerOptionCollection's value cannot be statically discovered.")]
private PropertyDescriptor GetOptionProperty(string pageName, string valueName)
{
if (pageName == null)
/// <summary>
/// Gets the value of an option defined in this package.
/// </summary>
+ [RequiresUnreferencedCode("The option value's Type cannot be statically discovered.")]
object IDesignerOptionService.GetOptionValue(string pageName, string valueName)
{
PropertyDescriptor optionProp = GetOptionProperty(pageName, valueName);
/// <summary>
/// Sets the value of an option defined in this package.
/// </summary>
+ [RequiresUnreferencedCode("The option value's Type cannot be statically discovered.")]
void IDesignerOptionService.SetOptionValue(string pageName, string valueName, object value)
{
PropertyDescriptor optionProp = GetOptionProperty(pageName, valueName);
/// </summary>
public PropertyDescriptorCollection Properties
{
+ [RequiresUnreferencedCode("The Type of DesignerOptionCollection's value cannot be statically discovered.")]
get
{
if (_properties == null)
{
public override bool GetPropertiesSupported(ITypeDescriptorContext cxt) => true;
+ [RequiresUnreferencedCode("The Type of value cannot be statically discovered. " + AttributeCollection.FilterRequiresUnreferencedCodeMessage)]
public override PropertyDescriptorCollection GetProperties(ITypeDescriptorContext cxt, object value, Attribute[] attributes)
{
PropertyDescriptorCollection props = new PropertyDescriptorCollection(null);
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
+using System.Diagnostics.CodeAnalysis;
+
namespace System.ComponentModel.Design
{
/// <summary>
/// <summary>
/// Gets the value of an option defined in this package.
/// </summary>
+ [RequiresUnreferencedCode("The option value's Type cannot be statically discovered.")]
object GetOptionValue(string pageName, string valueName);
/// <summary>
/// Sets the value of an option defined in this package.
/// </summary>
+ [RequiresUnreferencedCode("The option value's Type cannot be statically discovered.")]
void SetOptionValue(string pageName, string valueName, object value);
}
}
{
if (!relationship.IsEmpty && !SupportsRelationship(source, relationship))
{
- string sourceName = TypeDescriptor.GetComponentName(source.Owner);
- string relName = TypeDescriptor.GetComponentName(relationship.Owner);
- if (sourceName == null)
- {
- sourceName = source.Owner.ToString();
- }
- if (relName == null)
- {
- relName = relationship.Owner.ToString();
- }
- throw new ArgumentException(SR.Format(SR.MemberRelationshipService_RelationshipNotSupported, sourceName, source.Member.Name, relName, relationship.Member.Name));
+ ThrowRelationshipNotSupported(source, relationship);
}
_relationships[new RelationshipEntry(source)] = new RelationshipEntry(relationship);
}
+ [UnconditionalSuppressMessage("ReflectionAnalysis", "IL2026:RequiresUnreferencedCode",
+ Justification = "GetComponentName is only used to create a nice exception message, and has a fallback when null is returned.")]
+ private static void ThrowRelationshipNotSupported(MemberRelationship source, MemberRelationship relationship)
+ {
+ string sourceName = TypeDescriptor.GetComponentName(source.Owner);
+ string relName = TypeDescriptor.GetComponentName(relationship.Owner);
+ if (sourceName == null)
+ {
+ sourceName = source.Owner.ToString();
+ }
+ if (relName == null)
+ {
+ relName = relationship.Owner.ToString();
+ }
+ throw new ArgumentException(SR.Format(SR.MemberRelationshipService_RelationshipNotSupported, sourceName, source.Member.Name, relName, relationship.Member.Name));
+ }
+
/// <summary>
/// Returns true if the provided relationship is supported.
/// </summary>
using System.Collections;
using System.Collections.Generic;
using System.ComponentModel.Design.Serialization;
+using System.Diagnostics.CodeAnalysis;
using System.Globalization;
using System.Reflection;
/// Initializes a new instance of the <see cref='System.ComponentModel.EnumConverter'/> class for the given
/// type.
/// </summary>
- public EnumConverter(Type type)
+ public EnumConverter([DynamicallyAccessedMembers(TypeDescriptor.ReflectTypesDynamicallyAccessedMembers)] Type type)
{
EnumType = type;
}
+ [DynamicallyAccessedMembers(TypeDescriptor.ReflectTypesDynamicallyAccessedMembers)]
protected Type EnumType { get; }
protected StandardValuesCollection Values { get; set; }
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
+using System.Diagnostics.CodeAnalysis;
+
namespace System.ComponentModel
{
/// <summary>
/// Gets a collection of properties for the type of object
/// specified by the value parameter.
/// </summary>
+ [RequiresUnreferencedCode("The Type of value cannot be statically discovered. " + AttributeCollection.FilterRequiresUnreferencedCodeMessage)]
public override PropertyDescriptorCollection GetProperties(ITypeDescriptorContext context, object value, Attribute[] attributes)
{
return TypeDescriptor.GetProperties(value, attributes);
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
+using System.Diagnostics.CodeAnalysis;
+
namespace System.ComponentModel
{
/// <summary>
/// Gets the events for this instance of a component using the attribute array as a
/// filter.
/// </summary>
+ [RequiresUnreferencedCode(AttributeCollection.FilterRequiresUnreferencedCodeMessage)]
EventDescriptorCollection GetEvents(Attribute[] attributes);
/// <summary>
/// <summary>
/// Gets the properties for this instance of a component using the attribute array as a filter.
/// </summary>
+ [RequiresUnreferencedCode(AttributeCollection.FilterRequiresUnreferencedCodeMessage)]
PropertyDescriptorCollection GetProperties(Attribute[] attributes);
/// <summary>
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
+using System.Diagnostics.CodeAnalysis;
using System.Globalization;
namespace System.ComponentModel
/// Gets a collection of properties for the type of array specified by the value
/// parameter using the specified context and attributes.
/// </summary>
+ [RequiresUnreferencedCode("The Type of value cannot be statically discovered. " + AttributeCollection.FilterRequiresUnreferencedCodeMessage)]
public override PropertyDescriptorCollection GetProperties(ITypeDescriptorContext context, object value, Attribute[] attributes)
{
return null;
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
+using System.Diagnostics.CodeAnalysis;
using System.Globalization;
namespace System.ComponentModel
public string Name
{
get => _name;
+ [RequiresUnreferencedCode("The Type of components in the container cannot be statically discovered to validate the name.")]
set
{
if (value == null || _name == null || !value.Equals(_name))
using System.Collections;
using System.ComponentModel.Design.Serialization;
using System.Diagnostics;
+using System.Diagnostics.CodeAnalysis;
using System.Globalization;
using System.Reflection;
/// Gets a collection of properties for the type of array specified by the value
/// parameter using the specified context and attributes.
/// </summary>
+ [RequiresUnreferencedCode("The Type of value cannot be statically discovered. " + AttributeCollection.FilterRequiresUnreferencedCodeMessage)]
public override PropertyDescriptorCollection GetProperties(ITypeDescriptorContext context, object value, Attribute[] attributes)
{
if (UnderlyingTypeConverter != null)
/// </summary>
public virtual TypeConverter Converter
{
+ [RequiresUnreferencedCode("The PropertyDescriptor's PropertyType cannot be statically discovered.")]
get
{
// Always grab the attribute collection first here, because if the metadata version
base.FillAttributes(attributeList);
}
+ [RequiresUnreferencedCode("The PropertyDescriptor's PropertyType cannot be statically discovered.")]
public PropertyDescriptorCollection GetChildProperties() => GetChildProperties(null, null);
+ [RequiresUnreferencedCode("The PropertyDescriptor's PropertyType cannot be statically discovered. " + AttributeCollection.FilterRequiresUnreferencedCodeMessage)]
public PropertyDescriptorCollection GetChildProperties(Attribute[] filter) => GetChildProperties(null, filter);
+ [RequiresUnreferencedCode("The PropertyDescriptor's PropertyType cannot be statically discovered. The Type of instance cannot be statically discovered.")]
public PropertyDescriptorCollection GetChildProperties(object instance) => GetChildProperties(instance, null);
/// <summary>
/// Retrieves the properties
/// </summary>
+ [RequiresUnreferencedCode("The PropertyDescriptor's PropertyType cannot be statically discovered. The Type of instance cannot be statically discovered. " + AttributeCollection.FilterRequiresUnreferencedCodeMessage)]
public virtual PropertyDescriptorCollection GetChildProperties(object instance, Attribute[] filter)
{
if (instance == null)
}
}
-
/// <summary>
/// Gets an editor of the specified type.
/// </summary>
+ [RequiresUnreferencedCode("The PropertyDescriptor's PropertyType cannot be statically discovered.")]
public virtual object GetEditor(Type editorBaseType)
{
object editor = null;
using System.Collections;
using System.ComponentModel.Design;
using System.Diagnostics;
+using System.Diagnostics.CodeAnalysis;
using System.Globalization;
using System.Reflection;
private static readonly int s_bitSetOnDemand = InterlockedBitVector32.CreateMask(s_bitAmbientValueQueried);
private InterlockedBitVector32 _state; // Contains the state bits for this proeprty descriptor.
+ [DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)]
private readonly Type _componentClass; // used to determine if we should all on us or on the designer
private readonly Type _type; // the data type of the property
private object _defaultValue; // the default value of the property (or noValue)
/// <summary>
/// The main constructor for ReflectPropertyDescriptors.
/// </summary>
- public ReflectPropertyDescriptor(Type componentClass, string name, Type type, Attribute[] attributes)
+ public ReflectPropertyDescriptor(
+ [DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] Type componentClass,
+ string name,
+ Type type,
+ Attribute[] attributes)
: base(name, attributes)
{
Debug.WriteLine($"Creating ReflectPropertyDescriptor for {componentClass?.FullName}.{name}");
/// <summary>
/// A constructor for ReflectPropertyDescriptors that have no attributes.
/// </summary>
- public ReflectPropertyDescriptor(Type componentClass, string name, Type type, PropertyInfo propInfo, MethodInfo getMethod, MethodInfo setMethod, Attribute[] attrs) : this(componentClass, name, type, attrs)
+ public ReflectPropertyDescriptor(
+ [DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] Type componentClass,
+ string name,
+ Type type,
+ PropertyInfo propInfo,
+ MethodInfo getMethod,
+ MethodInfo setMethod,
+ Attribute[] attrs)
+ : this(componentClass, name, type, attrs)
{
_propInfo = propInfo;
_getMethod = getMethod;
/// <summary>
/// A constructor for ReflectPropertyDescriptors that creates an extender property.
/// </summary>
- public ReflectPropertyDescriptor(Type componentClass, string name, Type type, Type receiverType, MethodInfo getMethod, MethodInfo setMethod, Attribute[] attrs) : this(componentClass, name, type, attrs)
+ public ReflectPropertyDescriptor(
+ [DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] Type componentClass,
+ string name,
+ Type type,
+ Type receiverType,
+ MethodInfo getMethod,
+ MethodInfo setMethod,
+ Attribute[] attrs)
+ : this(componentClass, name, type, attrs)
{
_receiverType = receiverType;
_getMethod = getMethod;
/// This constructor takes an existing ReflectPropertyDescriptor and modifies it by merging in the
/// passed-in attributes.
/// </summary>
- public ReflectPropertyDescriptor(Type componentClass, PropertyDescriptor oldReflectPropertyDescriptor, Attribute[] attributes)
+ public ReflectPropertyDescriptor(
+ [DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] Type componentClass,
+ PropertyDescriptor oldReflectPropertyDescriptor,
+ Attribute[] attributes)
: base(oldReflectPropertyDescriptor, attributes)
{
_componentClass = componentClass;
{
if (!_state[s_bitChangedQueried])
{
- _realChangedEvent = TypeDescriptor.GetEvents(ComponentType)[Name + "Changed"];
+ _realChangedEvent = TypeDescriptor.GetEvents(_componentClass)[Name + "Changed"];
_state[s_bitChangedQueried] = true;
}
}
catch { }
}
- return Attributes.Contains(DesignerSerializationVisibilityAttribute.Content);
+ return AttributesContainsDesignerVisibilityContent();
}
else if (DefaultValue == s_noValue)
{
return !Equals(DefaultValue, ExtenderGetValue(provider, component));
}
+ [DynamicDependency(DynamicallyAccessedMemberTypes.PublicParameterlessConstructor | DynamicallyAccessedMemberTypes.PublicFields, typeof(DesignerSerializationVisibilityAttribute))]
+ [UnconditionalSuppressMessage("ReflectionAnalysis", "IL2026:RequiresUnreferencedCode", Justification = "The DynamicDependency ensures the correct members are preserved.")]
+ private bool AttributesContainsDesignerVisibilityContent() => Attributes.Contains(DesignerSerializationVisibilityAttribute.Content);
+
/// <summary>
/// Indicates whether reset will change the value of the component. If there
/// is a DefaultValueAttribute, then this will return true if getValue returns
}
catch { }
}
- return Attributes.Contains(DesignerSerializationVisibilityAttribute.Content);
+ return AttributesContainsDesignerVisibilityContent();
}
else if (DefaultValue == s_noValue)
{
using System.Collections;
using System.Collections.Generic;
-using System.Collections.Specialized;
using System.Diagnostics;
+using System.Diagnostics.CodeAnalysis;
using System.Reflection;
namespace System.ComponentModel
/// </summary>
private class ReflectedTypeData
{
+ [DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)]
private readonly Type _type;
private AttributeCollection _attributes;
private EventDescriptorCollection _events;
private Type[] _editorTypes;
private int _editorCount;
- internal ReflectedTypeData(Type type)
+ internal ReflectedTypeData([DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] Type type)
{
_type = type;
}
/// it will be used to retrieve attributes. Otherwise, _type
/// will be used.
/// </summary>
+ [RequiresUnreferencedCode("The Type of instance cannot be statically discovered.")]
internal TypeConverter GetConverter(object instance)
{
TypeConverterAttribute typeAttr = null;
/// Return the default event. The default event is determined by the
/// presence of a DefaultEventAttribute on the class.
/// </summary>
+ [RequiresUnreferencedCode("The Type of instance cannot be statically discovered.")]
internal EventDescriptor GetDefaultEvent(object instance)
{
AttributeCollection attributes;
/// <summary>
/// Return the default property.
/// </summary>
+ [RequiresUnreferencedCode("The Type of instance cannot be statically discovered.")]
internal PropertyDescriptor GetDefaultProperty(object instance)
{
AttributeCollection attributes;
/// <summary>
/// Retrieves the editor for the given base type.
/// </summary>
+ [RequiresUnreferencedCode("The Type of instance cannot be statically discovered.")]
internal object GetEditor(object instance, Type editorBaseType)
{
EditorAttribute typeAttr;
using System.Collections.Generic;
using System.ComponentModel.Design;
using System.Diagnostics;
+using System.Diagnostics.CodeAnalysis;
using System.Globalization;
using System.Linq;
using System.Reflection;
//
[typeof(Array)] = new IntrinsicTypeConverterData((type) => new ArrayConverter()),
[typeof(ICollection)] = new IntrinsicTypeConverterData((type) => new CollectionConverter()),
- [typeof(Enum)] = new IntrinsicTypeConverterData((type) => new EnumConverter(type), cacheConverterInstance: false),
+ [typeof(Enum)] = new IntrinsicTypeConverterData((type) => CreateEnumConverter(type), cacheConverterInstance: false),
[s_intrinsicNullableKey] = new IntrinsicTypeConverterData((type) => new NullableConverter(type), cacheConverterInstance: false),
[s_intrinsicReferenceKey] = new IntrinsicTypeConverterData((type) => new ReferenceConverter(type), cacheConverterInstance: false),
});
+ [UnconditionalSuppressMessage("ReflectionAnalysis", "IL2067:UnrecognizedReflectionPattern",
+ Justification = "Trimmer does not trim enums")]
+ private static EnumConverter CreateEnumConverter(Type type)
+ {
+ Debug.Assert(type.IsEnum || type == typeof(Enum));
+ return new EnumConverter(type);
+ }
+
private static Hashtable PropertyCache => LazyInitializer.EnsureInitialized(ref s_propertyCache, () => new Hashtable());
private static Hashtable EventCache => LazyInitializer.EnsureInitialized(ref s_eventCache, () => new Hashtable());
/// <summary>
/// Retrieves custom attributes.
/// </summary>
- internal AttributeCollection GetAttributes(Type type)
+ internal AttributeCollection GetAttributes([DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] Type type)
{
ReflectedTypeData td = GetTypeData(type, true);
return td.GetAttributes();
/// <summary>
/// Retrieves the class name for our type.
/// </summary>
- internal string GetClassName(Type type)
+ internal string GetClassName([DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] Type type)
{
ReflectedTypeData td = GetTypeData(type, true);
return td.GetClassName(null);
/// <summary>
/// Retrieves the component name from the site.
/// </summary>
- internal string GetComponentName(Type type, object instance)
+ internal string GetComponentName([DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] Type type, object instance)
{
ReflectedTypeData td = GetTypeData(type, true);
return td.GetComponentName(instance);
/// it will be used to retrieve attributes. Otherwise, _type
/// will be used.
/// </summary>
- internal TypeConverter GetConverter(Type type, object instance)
+ [RequiresUnreferencedCode("The Type of instance cannot be statically discovered.")]
+ internal TypeConverter GetConverter([DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] Type type, object instance)
{
ReflectedTypeData td = GetTypeData(type, true);
return td.GetConverter(instance);
/// Return the default event. The default event is determined by the
/// presence of a DefaultEventAttribute on the class.
/// </summary>
- internal EventDescriptor GetDefaultEvent(Type type, object instance)
+ [RequiresUnreferencedCode("The Type of instance cannot be statically discovered.")]
+ internal EventDescriptor GetDefaultEvent([DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] Type type, object instance)
{
ReflectedTypeData td = GetTypeData(type, true);
return td.GetDefaultEvent(instance);
/// <summary>
/// Return the default property.
/// </summary>
- internal PropertyDescriptor GetDefaultProperty(Type type, object instance)
+ [RequiresUnreferencedCode("The Type of instance cannot be statically discovered.")]
+ internal PropertyDescriptor GetDefaultProperty([DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] Type type, object instance)
{
ReflectedTypeData td = GetTypeData(type, true);
return td.GetDefaultProperty(instance);
/// <summary>
/// Retrieves the editor for the given base type.
/// </summary>
- internal object GetEditor(Type type, object instance, Type editorBaseType)
+ [RequiresUnreferencedCode("The Type of instance cannot be statically discovered.")]
+ internal object GetEditor([DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] Type type, object instance, Type editorBaseType)
{
ReflectedTypeData td = GetTypeData(type, true);
return td.GetEditor(instance, editorBaseType);
/// <summary>
/// Retrieves the events for this type.
/// </summary>
- internal EventDescriptorCollection GetEvents(Type type)
+ internal EventDescriptorCollection GetEvents([DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] Type type)
{
ReflectedTypeData td = GetTypeData(type, true);
return td.GetEvents();
/// <summary>
/// Retrieves the class name for our type.
/// </summary>
+ [RequiresUnreferencedCode("The Type of instance cannot be statically discovered.")]
internal string GetExtendedClassName(object instance)
{
return GetClassName(instance.GetType());
/// <summary>
/// Retrieves the component name from the site.
/// </summary>
+ [RequiresUnreferencedCode("The Type of instance cannot be statically discovered.")]
internal string GetExtendedComponentName(object instance)
{
return GetComponentName(instance.GetType(), instance);
/// it will be used to retrieve attributes. Otherwise, _type
/// will be used.
/// </summary>
+ [RequiresUnreferencedCode("The Type of instance cannot be statically discovered.")]
internal TypeConverter GetExtendedConverter(object instance)
{
return GetConverter(instance.GetType(), instance);
/// <summary>
/// Retrieves the editor for the given base type.
/// </summary>
+ [RequiresUnreferencedCode("The Type of instance cannot be statically discovered.")]
internal object GetExtendedEditor(object instance, Type editorBaseType)
{
return GetEditor(instance.GetType(), instance, editorBaseType);
/// <summary>
/// Retrieves the properties for this type.
/// </summary>
+ [RequiresUnreferencedCode("The Type of instance and its IExtenderProviders cannot be statically discovered.")]
internal PropertyDescriptorCollection GetExtendedProperties(object instance)
{
// Is this object a sited component? If not, then it
/// Provides a type descriptor for the given object. We only support this
/// if the object is a component that
/// </summary>
+ [RequiresUnreferencedCode("The Type of instance cannot be statically discovered.")]
public override ICustomTypeDescriptor GetExtendedTypeDescriptor(object instance)
{
Debug.Fail("This should never be invoked. TypeDescriptionNode should wrap for us.");
/// If not overridden, the default implementation of this method will call
/// GetComponentName.
/// </summary>
+ [RequiresUnreferencedCode("The Type of component cannot be statically discovered.")]
public override string GetFullComponentName(object component)
{
IComponent comp = component as IComponent;
/// <summary>
/// Retrieves the properties for this type.
/// </summary>
- internal PropertyDescriptorCollection GetProperties(Type type)
+ internal PropertyDescriptorCollection GetProperties([DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] Type type)
{
ReflectedTypeData td = GetTypeData(type, true);
return td.GetProperties();
/// Returns an Type for the given type. Since type implements IReflect,
/// we just return objectType.
/// </summary>
- public override Type GetReflectionType(Type objectType, object instance)
+ [return: DynamicallyAccessedMembers(TypeDescriptor.ReflectTypesDynamicallyAccessedMembers)]
+ public override Type GetReflectionType(
+ [DynamicallyAccessedMembers(TypeDescriptor.ReflectTypesDynamicallyAccessedMembers)] Type objectType,
+ object instance)
{
Debug.Assert(objectType != null, "Should have arg-checked before coming in here");
return objectType;
/// null if there is no type data for the type yet and
/// createIfNeeded is false.
/// </summary>
- private ReflectedTypeData GetTypeData(Type type, bool createIfNeeded)
+ private ReflectedTypeData GetTypeData([DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] Type type, bool createIfNeeded)
{
ReflectedTypeData td = null;
/// interested in providing type information for the object it should
/// return null.
/// </summary>
- public override ICustomTypeDescriptor GetTypeDescriptor(Type objectType, object instance)
+ public override ICustomTypeDescriptor GetTypeDescriptor([DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] Type objectType, object instance)
{
Debug.Fail("This should never be invoked. TypeDescriptionNode should wrap for us.");
return null;
/// This method returns true if the data cache in this reflection
/// type descriptor has data in it.
/// </summary>
+ [UnconditionalSuppressMessage("ReflectionAnalysis", "IL2067:UnrecognizedReflectionPattern",
+ Justification = "ReflectedTypeData is not being created here, just checking if was already created.")]
internal bool IsPopulated(Type type)
{
- ReflectedTypeData td = GetTypeData(type, false);
+ ReflectedTypeData td = GetTypeData(type, createIfNeeded: false);
if (td != null)
{
return td.IsPopulated;
/// Static helper API around reflection to get and cache
/// events. This does not recurse to the base class.
/// </summary>
- private static EventDescriptor[] ReflectGetEvents(Type type)
+ private static EventDescriptor[] ReflectGetEvents(
+ [DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] Type type)
{
Hashtable eventCache = EventCache;
EventDescriptor[] events = (EventDescriptor[])eventCache[type];
/// provider instance, and a per-provider cache that contains
/// the ExtendedPropertyDescriptors.
/// </summary>
+ [RequiresUnreferencedCode("The type of provider cannot be statically discovered.")]
private static PropertyDescriptor[] ReflectGetExtendedProperties(IExtenderProvider provider)
{
IDictionary cache = TypeDescriptor.GetCache(provider);
/// Static helper API around reflection to get and cache
/// properties. This does not recurse to the base class.
/// </summary>
- private static PropertyDescriptor[] ReflectGetProperties(Type type)
+ private static PropertyDescriptor[] ReflectGetProperties(
+ [DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] Type type)
{
Hashtable propertyCache = PropertyCache;
PropertyDescriptor[] properties = (PropertyDescriptor[])propertyCache[type];
/// actually requery, but it will clear our state so the next
/// query re-populates.
/// </summary>
+ [UnconditionalSuppressMessage("ReflectionAnalysis", "IL2067:UnrecognizedReflectionPattern",
+ Justification = "ReflectedTypeData is not being created here, just checking if was already created.")]
internal void Refresh(Type type)
{
- ReflectedTypeData td = GetTypeData(type, false);
+ ReflectedTypeData td = GetTypeData(type, createIfNeeded: false);
td?.Refresh();
}
/// <summary>
/// Gets a collection of properties for the type of array specified by the value parameter.
/// </summary>
+ [RequiresUnreferencedCode("The Type of value cannot be statically discovered.")]
public PropertyDescriptorCollection GetProperties(object value) => GetProperties(null, value);
/// <summary>
/// the specified context.
///
/// </summary>
+ [RequiresUnreferencedCode("The Type of value cannot be statically discovered.")]
+ [DynamicDependency(DynamicallyAccessedMemberTypes.PublicParameterlessConstructor | DynamicallyAccessedMemberTypes.PublicFields, typeof(BrowsableAttribute))]
public PropertyDescriptorCollection GetProperties(ITypeDescriptorContext context, object value)
{
return GetProperties(context, value, new Attribute[] { BrowsableAttribute.Yes });
/// the specified context and attributes.
///
/// </summary>
+ [RequiresUnreferencedCode("The Type of value cannot be statically discovered. " + AttributeCollection.FilterRequiresUnreferencedCodeMessage)]
public virtual PropertyDescriptorCollection GetProperties(ITypeDescriptorContext context, object value, Attribute[] attributes)
{
return null;
/// <summary>
/// Gets a value indicating whether this property is read-only.
/// </summary>
- public override bool IsReadOnly => Attributes.Contains(ReadOnlyAttribute.Yes);
+ public override bool IsReadOnly
+ {
+ [DynamicDependency(DynamicallyAccessedMemberTypes.PublicParameterlessConstructor | DynamicallyAccessedMemberTypes.PublicFields, typeof(ReadOnlyAttribute))]
+ [UnconditionalSuppressMessage("ReflectionAnalysis", "IL2026:RequiresUnreferencedCode", Justification = "The DynamicDependency ensures the correct members are preserved.")]
+ get { return Attributes.Contains(ReadOnlyAttribute.Yes); }
+ }
/// <summary>
/// Gets the type of the property.
// The .NET Foundation licenses this file to you under the MIT license.
using System.Collections;
-using System.Runtime.Versioning;
+using System.Diagnostics.CodeAnalysis;
namespace System.ComponentModel
{
/// model only supports extended properties this API can be used for extended
/// attributes and events as well, if the type description provider supports it.
/// </summary>
+ [RequiresUnreferencedCode("The Type of instance cannot be statically discovered.")]
public virtual ICustomTypeDescriptor GetExtendedTypeDescriptor(object instance)
{
if (_parent != null)
/// If not overridden, the default implementation of this method will call
/// GetTypeDescriptor.GetComponentName.
/// </summary>
+ [RequiresUnreferencedCode("The Type of component cannot be statically discovered.")]
public virtual string GetFullComponentName(object component)
{
if (_parent != null)
/// If no custom type descriptor can be located for an object, GetReflectionType
/// is called to perform normal reflection against the object.
/// </summary>
- public Type GetReflectionType(Type objectType) => GetReflectionType(objectType, null);
+ [return: DynamicallyAccessedMembers(TypeDescriptor.ReflectTypesDynamicallyAccessedMembers)]
+ public Type GetReflectionType([DynamicallyAccessedMembers(TypeDescriptor.ReflectTypesDynamicallyAccessedMembers)] Type objectType) => GetReflectionType(objectType, null);
/// <summary>
/// The GetReflection method is a lower level version of GetTypeDescriptor.
/// object type if no parent provider was passed. If a parent provider was passed, this
/// method will invoke the parent provider's GetReflectionType method.
/// </summary>
+ [RequiresUnreferencedCode("GetReflectionType is not trim compatible because the Type of object cannot be statically discovered.")]
public Type GetReflectionType(object instance)
{
if (instance == null)
/// object type if no parent provider was passed. If a parent provider was passed, this
/// method will invoke the parent provider's GetReflectionType method.
/// </summary>
- public virtual Type GetReflectionType(Type objectType, object instance)
+ [return: DynamicallyAccessedMembers(TypeDescriptor.ReflectTypesDynamicallyAccessedMembers)]
+ public virtual Type GetReflectionType(
+ [DynamicallyAccessedMembers(TypeDescriptor.ReflectTypesDynamicallyAccessedMembers)] Type objectType,
+ object instance)
{
if (_parent != null)
{
/// interested in providing type information for the object it should
/// return base.
/// </summary>
- public ICustomTypeDescriptor GetTypeDescriptor(Type objectType)
+ public ICustomTypeDescriptor GetTypeDescriptor([DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] Type objectType)
{
return GetTypeDescriptor(objectType, null);
}
/// interested in providing type information for the object it should
/// return base.
/// </summary>
+ [RequiresUnreferencedCode("The Type of instance cannot be statically discovered.")]
public ICustomTypeDescriptor GetTypeDescriptor(object instance)
{
if (instance == null)
/// this method will invoke the parent provider's GetTypeDescriptor
/// method.
/// </summary>
- public virtual ICustomTypeDescriptor GetTypeDescriptor(Type objectType, object instance)
+ public virtual ICustomTypeDescriptor GetTypeDescriptor([DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] Type objectType, object instance)
{
if (_parent != null)
{
using System.Diagnostics.CodeAnalysis;
using System.Globalization;
using System.Reflection;
-using System.Runtime.Versioning;
using System.Threading;
namespace System.ComponentModel
/// </summary>
public sealed class TypeDescriptor
{
+ internal const DynamicallyAccessedMemberTypes ReflectTypesDynamicallyAccessedMembers = DynamicallyAccessedMemberTypes.PublicParameterlessConstructor | DynamicallyAccessedMemberTypes.PublicFields;
+
// Note: this is initialized at class load because we
// lock on it for thread safety. It is used from nearly
// every call to this class, so it will be created soon after
return instance ?? NodeFor(objectType).CreateInstance(provider, objectType, argTypes, args);
}
+
/// <summary>
/// This dynamically binds a PropertyDescriptor to a type.
/// </summary>
- public static PropertyDescriptor CreateProperty(Type componentType, string name, Type type, params Attribute[] attributes)
+ public static PropertyDescriptor CreateProperty(
+ [DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] Type componentType,
+ string name,
+ Type type,
+ params Attribute[] attributes)
{
return new ReflectPropertyDescriptor(componentType, name, type, attributes);
}
/// This creates a new property descriptor identical to an existing property descriptor. The new property descriptor
/// has the specified metadata attributes merged with the existing metadata attributes.
/// </summary>
- public static PropertyDescriptor CreateProperty(Type componentType, PropertyDescriptor oldPropertyDescriptor, params Attribute[] attributes)
+ public static PropertyDescriptor CreateProperty(
+ [DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] Type componentType,
+ PropertyDescriptor oldPropertyDescriptor,
+ params Attribute[] attributes)
{
// We must do some special case work here for extended properties. If the old property descriptor is really
// an extender property that is being surfaced on a component as a normal property, then we must
/// contains only the remaining members. The API returns
/// NULL if it did not need to filter any members.
/// </summary>
+ [RequiresUnreferencedCode(AttributeCollection.FilterRequiresUnreferencedCodeMessage)]
private static ArrayList FilterMembers(IList members, Attribute[] attributes)
{
ArrayList newMembers = null;
/// <summary>
/// Gets a collection of attributes for the specified type of component.
/// </summary>
- public static AttributeCollection GetAttributes(Type componentType)
+ public static AttributeCollection GetAttributes([DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] Type componentType)
{
if (componentType == null)
{
/// <summary>
/// Gets a collection of attributes for the specified component.
/// </summary>
+ [RequiresUnreferencedCode("The Type of component cannot be statically discovered.")]
public static AttributeCollection GetAttributes(object component)
{
return GetAttributes(component, false);
/// Gets a collection of attributes for the specified component.
/// </summary>
[EditorBrowsable(EditorBrowsableState.Advanced)]
+ [RequiresUnreferencedCode("The Type of component cannot be statically discovered.")]
public static AttributeCollection GetAttributes(object component, bool noCustomTypeDesc)
{
if (component == null)
/// <summary>
/// Gets the name of the class for the specified component.
/// </summary>
+ [RequiresUnreferencedCode("The Type of component cannot be statically discovered.")]
public static string GetClassName(object component) => GetClassName(component, false);
/// <summary>
/// Gets the name of the class for the specified component.
/// </summary>
[EditorBrowsable(EditorBrowsableState.Advanced)]
+ [RequiresUnreferencedCode("The Type of component cannot be statically discovered.")]
public static string GetClassName(object component, bool noCustomTypeDesc)
{
return GetDescriptor(component, noCustomTypeDesc).GetClassName();
/// <summary>
/// Gets the name of the class for the specified type.
/// </summary>
- public static string GetClassName(Type componentType)
+ public static string GetClassName(
+ [DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] Type componentType)
{
return GetDescriptor(componentType, nameof(componentType)).GetClassName();
}
/// <summary>
/// The name of the class for the specified component.
/// </summary>
+ [RequiresUnreferencedCode("The Type of component cannot be statically discovered.")]
public static string GetComponentName(object component) => GetComponentName(component, false);
/// <summary>
/// Gets the name of the class for the specified component.
/// </summary>
[EditorBrowsable(EditorBrowsableState.Advanced)]
+ [RequiresUnreferencedCode("The Type of component cannot be statically discovered.")]
public static string GetComponentName(object component, bool noCustomTypeDesc)
{
return GetDescriptor(component, noCustomTypeDesc).GetComponentName();
/// <summary>
/// Gets a type converter for the type of the specified component.
/// </summary>
+ [RequiresUnreferencedCode("The Type of component cannot be statically discovered.")]
public static TypeConverter GetConverter(object component) => GetConverter(component, false);
/// <summary>
/// Gets a type converter for the type of the specified component.
/// </summary>
[EditorBrowsable(EditorBrowsableState.Advanced)]
+ [RequiresUnreferencedCode("The Type of component cannot be statically discovered.")]
public static TypeConverter GetConverter(object component, bool noCustomTypeDesc)
{
TypeConverter converter = GetDescriptor(component, noCustomTypeDesc).GetConverter();
/// <summary>
/// Gets a type converter for the specified type.
/// </summary>
- public static TypeConverter GetConverter(Type type)
+ public static TypeConverter GetConverter([DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] Type type)
{
return GetDescriptor(type, nameof(type)).GetConverter();
}
// This is called by System.ComponentModel.DefaultValueAttribute via reflection.
- private static object ConvertFromInvariantString(Type type, string stringValue)
+ private static object ConvertFromInvariantString([DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] Type type, string stringValue)
{
return GetConverter(type).ConvertFromInvariantString(stringValue);
}
/// <summary>
/// Gets the default event for the specified type of component.
/// </summary>
- public static EventDescriptor GetDefaultEvent(Type componentType)
+ public static EventDescriptor GetDefaultEvent(
+ [DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] Type componentType)
{
if (componentType == null)
{
/// <summary>
/// Gets the default event for the specified component.
/// </summary>
+ [RequiresUnreferencedCode("The Type of component cannot be statically discovered.")]
public static EventDescriptor GetDefaultEvent(object component) => GetDefaultEvent(component, false);
/// <summary>
/// Gets the default event for a component.
/// </summary>
[EditorBrowsable(EditorBrowsableState.Advanced)]
+ [RequiresUnreferencedCode("The Type of component cannot be statically discovered.")]
public static EventDescriptor GetDefaultEvent(object component, bool noCustomTypeDesc)
{
if (component == null)
/// <summary>
/// Gets the default property for the specified type of component.
/// </summary>
- public static PropertyDescriptor GetDefaultProperty(Type componentType)
+ public static PropertyDescriptor GetDefaultProperty(
+ [DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] Type componentType)
{
if (componentType == null)
{
/// <summary>
/// Gets the default property for the specified component.
/// </summary>
+ [RequiresUnreferencedCode("The Type of component cannot be statically discovered.")]
public static PropertyDescriptor GetDefaultProperty(object component) => GetDefaultProperty(component, false);
/// <summary>
/// Gets the default property for the specified component.
/// </summary>
[EditorBrowsable(EditorBrowsableState.Advanced)]
+ [RequiresUnreferencedCode("The Type of component cannot be statically discovered.")]
public static PropertyDescriptor GetDefaultProperty(object component, bool noCustomTypeDesc)
{
if (component == null)
/// Returns a custom type descriptor for the given type.
/// Performs arg checking so callers don't have to.
/// </summary>
- internal static ICustomTypeDescriptor GetDescriptor(Type type, string typeName)
+ internal static ICustomTypeDescriptor GetDescriptor(
+ [DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] Type type,
+ string typeName)
{
if (type == null)
{
/// will call through to instance if it is a custom type
/// descriptor.
/// </summary>
+ [RequiresUnreferencedCode("The Type of component cannot be statically discovered.")]
internal static ICustomTypeDescriptor GetDescriptor(object component, bool noCustomTypeDesc)
{
if (component == null)
/// <summary>
/// Returns an extended custom type descriptor for the given instance.
/// </summary>
+ [RequiresUnreferencedCode("The Type of component cannot be statically discovered.")]
internal static ICustomTypeDescriptor GetExtendedDescriptor(object component)
{
if (component == null)
/// Gets an editor with the specified base type for the
/// specified component.
/// </summary>
+ [RequiresUnreferencedCode("The Type of component cannot be statically discovered.")]
public static object GetEditor(object component, Type editorBaseType)
{
return GetEditor(component, editorBaseType, false);
/// specified component.
/// </summary>
[EditorBrowsable(EditorBrowsableState.Advanced)]
+ [RequiresUnreferencedCode("The Type of component cannot be statically discovered.")]
public static object GetEditor(object component, Type editorBaseType, bool noCustomTypeDesc)
{
if (editorBaseType == null)
/// <summary>
/// Gets an editor with the specified base type for the specified type.
/// </summary>
- public static object GetEditor(Type type, Type editorBaseType)
+ public static object GetEditor(
+ [DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] Type type,
+ Type editorBaseType)
{
if (editorBaseType == null)
{
/// <summary>
/// Gets a collection of events for a specified type of component.
/// </summary>
- public static EventDescriptorCollection GetEvents(Type componentType)
+ public static EventDescriptorCollection GetEvents(
+ [DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] Type componentType)
{
if (componentType == null)
{
/// Gets a collection of events for a specified type of
/// component using a specified array of attributes as a filter.
/// </summary>
- public static EventDescriptorCollection GetEvents(Type componentType, Attribute[] attributes)
+ [RequiresUnreferencedCode(AttributeCollection.FilterRequiresUnreferencedCodeMessage)]
+ public static EventDescriptorCollection GetEvents(
+ [DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] Type componentType,
+ Attribute[] attributes)
{
if (componentType == null)
{
/// <summary>
/// Gets a collection of events for a specified component.
/// </summary>
+ [RequiresUnreferencedCode("The Type of component cannot be statically discovered.")]
public static EventDescriptorCollection GetEvents(object component)
{
return GetEvents(component, null, false);
/// Gets a collection of events for a specified component.
/// </summary>
[EditorBrowsable(EditorBrowsableState.Advanced)]
+ [RequiresUnreferencedCode("The Type of component cannot be statically discovered.")]
public static EventDescriptorCollection GetEvents(object component, bool noCustomTypeDesc)
{
return GetEvents(component, null, noCustomTypeDesc);
/// Gets a collection of events for a specified component
/// using a specified array of attributes as a filter.
/// </summary>
+ [RequiresUnreferencedCode("The Type of component cannot be statically discovered. " + AttributeCollection.FilterRequiresUnreferencedCodeMessage)]
public static EventDescriptorCollection GetEvents(object component, Attribute[] attributes)
{
return GetEvents(component, attributes, false);
/// using a specified array of attributes as a filter.
/// </summary>
[EditorBrowsable(EditorBrowsableState.Advanced)]
+ [RequiresUnreferencedCode("The Type of component cannot be statically discovered. " + AttributeCollection.FilterRequiresUnreferencedCodeMessage)]
public static EventDescriptorCollection GetEvents(object component, Attribute[] attributes, bool noCustomTypeDesc)
{
if (component == null)
/// component resides in a nested container or has other nested semantics, it may
/// return a different fully qualified name.
/// </summary>
+ [RequiresUnreferencedCode("The Type of component cannot be statically discovered.")]
public static string GetFullComponentName(object component)
{
if (component == null)
/// <summary>
/// Gets a collection of properties for a specified type of component.
/// </summary>
- public static PropertyDescriptorCollection GetProperties(Type componentType)
+ public static PropertyDescriptorCollection GetProperties(
+ [DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] Type componentType)
{
if (componentType == null)
{
/// Gets a collection of properties for a specified type of
/// component using a specified array of attributes as a filter.
/// </summary>
- public static PropertyDescriptorCollection GetProperties(Type componentType, Attribute[] attributes)
+ [RequiresUnreferencedCode(AttributeCollection.FilterRequiresUnreferencedCodeMessage)]
+ public static PropertyDescriptorCollection GetProperties(
+ [DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] Type componentType,
+ Attribute[] attributes)
{
if (componentType == null)
{
/// <summary>
/// Gets a collection of properties for a specified component.
/// </summary>
+ [RequiresUnreferencedCode("The Type of component cannot be statically discovered.")]
public static PropertyDescriptorCollection GetProperties(object component)
{
return GetProperties(component, false);
/// Gets a collection of properties for a specified component.
/// </summary>
[EditorBrowsable(EditorBrowsableState.Advanced)]
+ [RequiresUnreferencedCode("The Type of component cannot be statically discovered.")]
public static PropertyDescriptorCollection GetProperties(object component, bool noCustomTypeDesc)
{
return GetPropertiesImpl(component, null, noCustomTypeDesc, true);
/// component using a specified array of attributes
/// as a filter.
/// </summary>
+ [RequiresUnreferencedCode("The Type of component cannot be statically discovered. " + AttributeCollection.FilterRequiresUnreferencedCodeMessage)]
public static PropertyDescriptorCollection GetProperties(object component, Attribute[] attributes)
{
return GetProperties(component, attributes, false);
/// component using a specified array of attributes
/// as a filter.
/// </summary>
+ [RequiresUnreferencedCode("The Type of component cannot be statically discovered. " + AttributeCollection.FilterRequiresUnreferencedCodeMessage)]
public static PropertyDescriptorCollection GetProperties(object component, Attribute[] attributes, bool noCustomTypeDesc)
{
return GetPropertiesImpl(component, attributes, noCustomTypeDesc, false);
/// only if noAttributes is false. This is to preserve backward compat for the case when
/// no attribute filter was passed in (as against passing in null).
/// </summary>
+ [RequiresUnreferencedCode("The Type of component cannot be statically discovered. " + AttributeCollection.FilterRequiresUnreferencedCodeMessage)]
private static PropertyDescriptorCollection GetPropertiesImpl(object component, Attribute[] attributes, bool noCustomTypeDesc, bool noAttributes)
{
if (component == null)
/// Returns an Type instance that can be used to perform reflection.
/// </summary>
[EditorBrowsable(EditorBrowsableState.Advanced)]
- public static Type GetReflectionType(Type type)
+ [return: DynamicallyAccessedMembers(ReflectTypesDynamicallyAccessedMembers)]
+ public static Type GetReflectionType([DynamicallyAccessedMembers(ReflectTypesDynamicallyAccessedMembers)] Type type)
{
if (type == null)
{
return NodeFor(type).GetReflectionType(type);
}
-
/// <summary>
/// Returns an Type instance that can be used to perform reflection.
/// </summary>
[EditorBrowsable(EditorBrowsableState.Advanced)]
+ [RequiresUnreferencedCode("GetReflectionType is not trim compatible because the Type of object cannot be statically discovered.")]
public static Type GetReflectionType(object instance)
{
if (instance == null)
/// This is the last stage in our filtering pipeline. Here, we apply any
/// user-defined filter.
/// </summary>
+ [RequiresUnreferencedCode(AttributeCollection.FilterRequiresUnreferencedCodeMessage)]
private static ICollection PipelineAttributeFilter(int pipelineType, ICollection members, Attribute[] filter, object instance, IDictionary cache)
{
Debug.Assert(pipelineType != PIPELINE_ATTRIBUTES, "PipelineAttributeFilter is not supported for attributes");
get => typeof(TypeDescriptorComObject);
}
+ [RequiresUnreferencedCode("The Type of component cannot be statically discovered.")]
public static IDesigner CreateDesigner(IComponent component, Type designerBaseType)
{
Type type = null;
/// contains the attribute or the member does not contain the attribute and the default
/// for the attribute matches the passed in attribute.
/// </summary>
+ [RequiresUnreferencedCode(AttributeCollection.FilterRequiresUnreferencedCodeMessage)]
private static bool ShouldHideMember(MemberDescriptor member, Attribute attribute)
{
if (member == null || attribute == null)
/// Implements GetTypeDescriptor. This creates a custom type
/// descriptor that walks the linked list for each of its calls.
/// </summary>
- public override ICustomTypeDescriptor GetTypeDescriptor(Type objectType, object instance)
+ public override ICustomTypeDescriptor GetTypeDescriptor([DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] Type objectType, object instance)
{
if (objectType == null)
{
return _handler.GetEvents(_instance);
}
+ [RequiresUnreferencedCode(AttributeCollection.FilterRequiresUnreferencedCodeMessage)]
EventDescriptorCollection ICustomTypeDescriptor.GetEvents(Attribute[] attributes)
{
return _handler.GetEvents(_instance, attributes);
return _handler.GetProperties(_instance, null);
}
+ [RequiresUnreferencedCode(AttributeCollection.FilterRequiresUnreferencedCodeMessage)]
PropertyDescriptorCollection ICustomTypeDescriptor.GetProperties(Attribute[] attributes)
{
return _handler.GetProperties(_instance, attributes);
/// <summary>
/// Creates a custom type descriptor that replaces the attributes.
/// </summary>
- public override ICustomTypeDescriptor GetTypeDescriptor(Type objectType, object instance)
+ public override ICustomTypeDescriptor GetTypeDescriptor([DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] Type objectType, object instance)
{
return new AttributeTypeDescriptor(_attrs, base.GetTypeDescriptor(objectType, instance));
}
_comNativeDescriptor = (TypeDescriptionProvider)Activator.CreateInstance(realComNativeDescriptor);
}
- public override ICustomTypeDescriptor GetTypeDescriptor(Type objectType, object instance)
+ public override ICustomTypeDescriptor GetTypeDescriptor([DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] Type objectType, object instance)
{
return _comNativeDescriptor.GetTypeDescriptor(objectType, instance);
}
/// <summary>
/// ICustomTypeDescriptor implementation.
/// </summary>
+ [RequiresUnreferencedCode(AttributeCollection.FilterRequiresUnreferencedCodeMessage)]
EventDescriptorCollection ICustomTypeDescriptor.GetEvents(Attribute[] attributes)
{
EventDescriptorCollection events = _primary.GetEvents(attributes) ?? _secondary.GetEvents(attributes);
/// <summary>
/// ICustomTypeDescriptor implementation.
/// </summary>
+ [RequiresUnreferencedCode(AttributeCollection.FilterRequiresUnreferencedCodeMessage)]
PropertyDescriptorCollection ICustomTypeDescriptor.GetProperties(Attribute[] attributes)
{
PropertyDescriptorCollection properties = _primary.GetProperties(attributes);
/// Implements GetExtendedTypeDescriptor. This creates a custom type
/// descriptor that walks the linked list for each of its calls.
/// </summary>
+ [RequiresUnreferencedCode("The Type of instance cannot be statically discovered.")]
public override ICustomTypeDescriptor GetExtendedTypeDescriptor(object instance)
{
if (instance == null)
/// If not overridden, the default implementation of this method will call
/// GetTypeDescriptor.GetComponentName.
/// </summary>
+ [RequiresUnreferencedCode("The Type of component cannot be statically discovered.")]
public override string GetFullComponentName(object component)
{
if (component == null)
/// Implements GetReflectionType. This just walks the linked list
/// looking for someone who implements the call.
/// </summary>
- public override Type GetReflectionType(Type objectType, object instance)
+ [return: DynamicallyAccessedMembers(ReflectTypesDynamicallyAccessedMembers)]
+ public override Type GetReflectionType(
+ [DynamicallyAccessedMembers(ReflectTypesDynamicallyAccessedMembers)] Type objectType,
+ object instance)
{
if (objectType == null)
{
/// Implements GetTypeDescriptor. This creates a custom type
/// descriptor that walks the linked list for each of its calls.
/// </summary>
- public override ICustomTypeDescriptor GetTypeDescriptor(Type objectType, object instance)
+ public override ICustomTypeDescriptor GetTypeDescriptor([DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] Type objectType, object instance)
{
if (objectType == null)
{
/// <summary>
/// Creates a new WalkingExtendedTypeDescriptor.
/// </summary>
+ [RequiresUnreferencedCode("The Type of instance cannot be statically discovered.")]
internal DefaultExtendedTypeDescriptor(TypeDescriptionNode node, object instance)
{
_node = node;
/// <summary>
/// ICustomTypeDescriptor implementation.
/// </summary>
+ [UnconditionalSuppressMessage("ReflectionAnalysis", "IL2026:RequiresUnreferencedCode", Justification = "The ctor of this Type has RequiresUnreferencedCode.")]
AttributeCollection ICustomTypeDescriptor.GetAttributes()
{
// Check to see if the provider we get is a ReflectTypeDescriptionProvider.
/// <summary>
/// ICustomTypeDescriptor implementation.
/// </summary>
+ [UnconditionalSuppressMessage("ReflectionAnalysis", "IL2026:RequiresUnreferencedCode", Justification = "The ctor of this Type has RequiresUnreferencedCode.")]
string ICustomTypeDescriptor.GetClassName()
{
// Check to see if the provider we get is a ReflectTypeDescriptionProvider.
/// <summary>
/// ICustomTypeDescriptor implementation.
/// </summary>
+ [UnconditionalSuppressMessage("ReflectionAnalysis", "IL2026:RequiresUnreferencedCode", Justification = "The ctor of this Type has RequiresUnreferencedCode.")]
string ICustomTypeDescriptor.GetComponentName()
{
// Check to see if the provider we get is a ReflectTypeDescriptionProvider.
/// <summary>
/// ICustomTypeDescriptor implementation.
/// </summary>
+ [UnconditionalSuppressMessage("ReflectionAnalysis", "IL2026:RequiresUnreferencedCode", Justification = "The ctor of this Type has RequiresUnreferencedCode.")]
TypeConverter ICustomTypeDescriptor.GetConverter()
{
// Check to see if the provider we get is a ReflectTypeDescriptionProvider.
/// <summary>
/// ICustomTypeDescriptor implementation.
/// </summary>
+ [UnconditionalSuppressMessage("ReflectionAnalysis", "IL2026:RequiresUnreferencedCode", Justification = "The ctor of this Type has RequiresUnreferencedCode.")]
EventDescriptor ICustomTypeDescriptor.GetDefaultEvent()
{
// Check to see if the provider we get is a ReflectTypeDescriptionProvider.
/// <summary>
/// ICustomTypeDescriptor implementation.
/// </summary>
+ [UnconditionalSuppressMessage("ReflectionAnalysis", "IL2026:RequiresUnreferencedCode", Justification = "The ctor of this Type has RequiresUnreferencedCode.")]
PropertyDescriptor ICustomTypeDescriptor.GetDefaultProperty()
{
// Check to see if the provider we get is a ReflectTypeDescriptionProvider.
/// <summary>
/// ICustomTypeDescriptor implementation.
/// </summary>
+ [UnconditionalSuppressMessage("ReflectionAnalysis", "IL2026:RequiresUnreferencedCode", Justification = "The ctor of this Type has RequiresUnreferencedCode.")]
object ICustomTypeDescriptor.GetEditor(Type editorBaseType)
{
if (editorBaseType == null)
/// <summary>
/// ICustomTypeDescriptor implementation.
/// </summary>
+ [UnconditionalSuppressMessage("ReflectionAnalysis", "IL2026:RequiresUnreferencedCode", Justification = "The ctor of this Type has RequiresUnreferencedCode.")]
EventDescriptorCollection ICustomTypeDescriptor.GetEvents()
{
// Check to see if the provider we get is a ReflectTypeDescriptionProvider.
/// <summary>
/// ICustomTypeDescriptor implementation.
/// </summary>
+ [RequiresUnreferencedCode(AttributeCollection.FilterRequiresUnreferencedCodeMessage)]
EventDescriptorCollection ICustomTypeDescriptor.GetEvents(Attribute[] attributes)
{
// Check to see if the provider we get is a ReflectTypeDescriptionProvider.
/// <summary>
/// ICustomTypeDescriptor implementation.
/// </summary>
+ [UnconditionalSuppressMessage("ReflectionAnalysis", "IL2026:RequiresUnreferencedCode", Justification = "The ctor of this Type has RequiresUnreferencedCode.")]
PropertyDescriptorCollection ICustomTypeDescriptor.GetProperties()
{
// Check to see if the provider we get is a ReflectTypeDescriptionProvider.
/// <summary>
/// ICustomTypeDescriptor implementation.
/// </summary>
+ [RequiresUnreferencedCode(AttributeCollection.FilterRequiresUnreferencedCodeMessage)]
PropertyDescriptorCollection ICustomTypeDescriptor.GetProperties(Attribute[] attributes)
{
// Check to see if the provider we get is a ReflectTypeDescriptionProvider.
/// <summary>
/// ICustomTypeDescriptor implementation.
/// </summary>
+ [UnconditionalSuppressMessage("ReflectionAnalysis", "IL2026:RequiresUnreferencedCode", Justification = "The ctor of this Type has RequiresUnreferencedCode.")]
object ICustomTypeDescriptor.GetPropertyOwner(PropertyDescriptor pd)
{
// Check to see if the provider we get is a ReflectTypeDescriptionProvider.
private readonly struct DefaultTypeDescriptor : ICustomTypeDescriptor
{
private readonly TypeDescriptionNode _node;
+ [DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)]
private readonly Type _objectType;
private readonly object _instance;
/// <summary>
/// Creates a new WalkingTypeDescriptor.
/// </summary>
- internal DefaultTypeDescriptor(TypeDescriptionNode node, Type objectType, object instance)
+ internal DefaultTypeDescriptor(
+ TypeDescriptionNode node,
+ [DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] Type objectType,
+ object instance)
{
_node = node;
_objectType = objectType;
/// <summary>
/// ICustomTypeDescriptor implementation.
/// </summary>
+ [RequiresUnreferencedCode(AttributeCollection.FilterRequiresUnreferencedCodeMessage)]
EventDescriptorCollection ICustomTypeDescriptor.GetEvents(Attribute[] attributes)
{
// Check to see if the provider we get is a ReflectTypeDescriptionProvider.
/// <summary>
/// ICustomTypeDescriptor implementation.
/// </summary>
+ [RequiresUnreferencedCode(AttributeCollection.FilterRequiresUnreferencedCodeMessage)]
PropertyDescriptorCollection ICustomTypeDescriptor.GetProperties(Attribute[] attributes)
{
// Check to see if the provider we get is a ReflectTypeDescriptionProvider.
private static readonly string[] s_propertySort = { "X", "Y" };
+ [RequiresUnreferencedCode("The Type of value cannot be statically discovered. " + AttributeCollection.FilterRequiresUnreferencedCodeMessage)]
public override PropertyDescriptorCollection GetProperties(ITypeDescriptorContext context, object value, Attribute[] attributes)
{
PropertyDescriptorCollection props = TypeDescriptor.GetProperties(typeof(Point), attributes);
private static readonly string[] s_propertySort = { "X", "Y", "Width", "Height" };
+ [RequiresUnreferencedCode("The Type of value cannot be statically discovered. " + AttributeCollection.FilterRequiresUnreferencedCodeMessage)]
public override PropertyDescriptorCollection GetProperties(ITypeDescriptorContext context, object value, Attribute[] attributes)
{
PropertyDescriptorCollection props = TypeDescriptor.GetProperties(typeof(Rectangle), attributes);
private static readonly string[] s_propertySort = { "Width", "Height" };
+ [RequiresUnreferencedCode("The Type of value cannot be statically discovered. " + AttributeCollection.FilterRequiresUnreferencedCodeMessage)]
public override PropertyDescriptorCollection GetProperties(ITypeDescriptorContext context, object value, Attribute[] attributes)
{
PropertyDescriptorCollection props = TypeDescriptor.GetProperties(typeof(Size), attributes);
private static readonly string[] s_propertySort = { "Width", "Height" };
+ [RequiresUnreferencedCode("The Type of value cannot be statically discovered. " + AttributeCollection.FilterRequiresUnreferencedCodeMessage)]
public override PropertyDescriptorCollection GetProperties(ITypeDescriptorContext context, object value, Attribute[] attributes)
{
PropertyDescriptorCollection props = TypeDescriptor.GetProperties(typeof(SizeF), attributes);
--- /dev/null
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+
+using System;
+using System.Collections;
+using System.ComponentModel;
+
+/// <summary>
+/// Tests that SimplePropertyDescriptor.IsReadOnly works correctly when trimming.
+/// </summary>
+class Program
+{
+ static int Main()
+ {
+ PropertyDescriptor property = MyTypeConverter.CreatePropertyDescriptor(isReadOnly: false);
+ if (property.IsReadOnly)
+ {
+ return -1;
+ }
+
+ property = MyTypeConverter.CreatePropertyDescriptor(isReadOnly: true);
+ if (!property.IsReadOnly)
+ {
+ return -2;
+ }
+
+ Type readOnlyAttributeType = property.Attributes[0].GetType();
+ if (readOnlyAttributeType.Name != "ReadOnlyAttribute")
+ {
+ return -3;
+ }
+
+ // check to make sure the 'ReadOnlyAttribute.Default' static field is preserved
+ if (readOnlyAttributeType.GetField("Default") == null)
+ {
+ return -4;
+ }
+
+ return 100;
+ }
+}
+
+internal class MyTypeConverter : TypeConverter
+{
+ protected class MyPropertyDescriptor : SimplePropertyDescriptor
+ {
+ private readonly bool _isReadOnly;
+
+ public MyPropertyDescriptor(bool isReadOnly) : base(typeof(Program), "property", typeof(int))
+ {
+ _isReadOnly = isReadOnly;
+ }
+
+ protected override void FillAttributes(IList attributeList)
+ {
+ if (_isReadOnly)
+ {
+ attributeList.Add(ReadOnlyAttribute.Yes);
+ }
+
+ base.FillAttributes(attributeList);
+ }
+
+ public override object GetValue(object component) => null;
+ public override void SetValue(object component, object value) { }
+ }
+
+ public static PropertyDescriptor CreatePropertyDescriptor(bool isReadOnly)
+ {
+ return new MyPropertyDescriptor(isReadOnly);
+ }
+}
System.ComponentModel.PropertyDescriptor System.ComponentModel.ICustomTypeDescriptor.GetDefaultProperty() { throw null; }
object System.ComponentModel.ICustomTypeDescriptor.GetEditor(System.Type editorBaseType) { throw null; }
System.ComponentModel.EventDescriptorCollection System.ComponentModel.ICustomTypeDescriptor.GetEvents() { throw null; }
+ [System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("The public parameterless constructor or the 'Default' static field may be trimmed from the Attribute's Type.")]
System.ComponentModel.EventDescriptorCollection System.ComponentModel.ICustomTypeDescriptor.GetEvents(System.Attribute[] attributes) { throw null; }
System.ComponentModel.PropertyDescriptorCollection System.ComponentModel.ICustomTypeDescriptor.GetProperties() { throw null; }
+ [System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("The public parameterless constructor or the 'Default' static field may be trimmed from the Attribute's Type.")]
System.ComponentModel.PropertyDescriptorCollection System.ComponentModel.ICustomTypeDescriptor.GetProperties(System.Attribute[] attributes) { throw null; }
object System.ComponentModel.ICustomTypeDescriptor.GetPropertyOwner(System.ComponentModel.PropertyDescriptor pd) { throw null; }
#nullable enable
System.ComponentModel.PropertyDescriptor System.ComponentModel.ICustomTypeDescriptor.GetDefaultProperty() { throw null; }
object System.ComponentModel.ICustomTypeDescriptor.GetEditor(System.Type editorBaseType) { throw null; }
System.ComponentModel.EventDescriptorCollection System.ComponentModel.ICustomTypeDescriptor.GetEvents() { throw null; }
+ [System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("The public parameterless constructor or the 'Default' static field may be trimmed from the Attribute's Type.")]
System.ComponentModel.EventDescriptorCollection System.ComponentModel.ICustomTypeDescriptor.GetEvents(System.Attribute[] attributes) { throw null; }
System.ComponentModel.PropertyDescriptorCollection System.ComponentModel.ICustomTypeDescriptor.GetProperties() { throw null; }
+ [System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("The public parameterless constructor or the 'Default' static field may be trimmed from the Attribute's Type.")]
System.ComponentModel.PropertyDescriptorCollection System.ComponentModel.ICustomTypeDescriptor.GetProperties(System.Attribute[] attributes) { throw null; }
object System.ComponentModel.ICustomTypeDescriptor.GetPropertyOwner(System.ComponentModel.PropertyDescriptor pd) { throw null; }
public override string ToString() { throw null; }
System.ComponentModel.PropertyDescriptor System.ComponentModel.ICustomTypeDescriptor.GetDefaultProperty() { throw null; }
object System.ComponentModel.ICustomTypeDescriptor.GetEditor(System.Type editorBaseType) { throw null; }
System.ComponentModel.EventDescriptorCollection System.ComponentModel.ICustomTypeDescriptor.GetEvents() { throw null; }
+ [System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("The public parameterless constructor or the 'Default' static field may be trimmed from the Attribute's Type.")]
System.ComponentModel.EventDescriptorCollection System.ComponentModel.ICustomTypeDescriptor.GetEvents(System.Attribute[] attributes) { throw null; }
System.ComponentModel.PropertyDescriptorCollection System.ComponentModel.ICustomTypeDescriptor.GetProperties() { throw null; }
+ [System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("The public parameterless constructor or the 'Default' static field may be trimmed from the Attribute's Type.")]
System.ComponentModel.PropertyDescriptorCollection System.ComponentModel.ICustomTypeDescriptor.GetProperties(System.Attribute[] attributes) { throw null; }
object System.ComponentModel.ICustomTypeDescriptor.GetPropertyOwner(System.ComponentModel.PropertyDescriptor pd) { throw null; }
#nullable enable
<property name="Scope">member</property>
<property name="Target">M:System.Data.DataSet.SerializeDataSet(System.Runtime.Serialization.SerializationInfo,System.Runtime.Serialization.StreamingContext,System.Data.SerializationFormat)</property>
</attribute>
+ <attribute fullname="System.Diagnostics.CodeAnalysis.UnconditionalSuppressMessageAttribute">
+ <argument>ILLink</argument>
+ <argument>IL2026</argument>
+ <property name="Scope">member</property>
+ <property name="Target">M:System.Data.Common.DbConnectionStringBuilder.GetProperties(System.Collections.Hashtable)</property>
+ </attribute>
+ <attribute fullname="System.Diagnostics.CodeAnalysis.UnconditionalSuppressMessageAttribute">
+ <argument>ILLink</argument>
+ <argument>IL2026</argument>
+ <property name="Scope">member</property>
+ <property name="Target">M:System.Data.Common.DbConnectionStringBuilder.System#ComponentModel#ICustomTypeDescriptor#GetAttributes</property>
+ </attribute>
+ <attribute fullname="System.Diagnostics.CodeAnalysis.UnconditionalSuppressMessageAttribute">
+ <argument>ILLink</argument>
+ <argument>IL2026</argument>
+ <property name="Scope">member</property>
+ <property name="Target">M:System.Data.Common.DbConnectionStringBuilder.System#ComponentModel#ICustomTypeDescriptor#GetClassName</property>
+ </attribute>
+ <attribute fullname="System.Diagnostics.CodeAnalysis.UnconditionalSuppressMessageAttribute">
+ <argument>ILLink</argument>
+ <argument>IL2026</argument>
+ <property name="Scope">member</property>
+ <property name="Target">M:System.Data.Common.DbConnectionStringBuilder.System#ComponentModel#ICustomTypeDescriptor#GetComponentName</property>
+ </attribute>
+ <attribute fullname="System.Diagnostics.CodeAnalysis.UnconditionalSuppressMessageAttribute">
+ <argument>ILLink</argument>
+ <argument>IL2026</argument>
+ <property name="Scope">member</property>
+ <property name="Target">M:System.Data.Common.DbConnectionStringBuilder.System#ComponentModel#ICustomTypeDescriptor#GetConverter</property>
+ </attribute>
+ <attribute fullname="System.Diagnostics.CodeAnalysis.UnconditionalSuppressMessageAttribute">
+ <argument>ILLink</argument>
+ <argument>IL2026</argument>
+ <property name="Scope">member</property>
+ <property name="Target">M:System.Data.Common.DbConnectionStringBuilder.System#ComponentModel#ICustomTypeDescriptor#GetDefaultEvent</property>
+ </attribute>
+ <attribute fullname="System.Diagnostics.CodeAnalysis.UnconditionalSuppressMessageAttribute">
+ <argument>ILLink</argument>
+ <argument>IL2026</argument>
+ <property name="Scope">member</property>
+ <property name="Target">M:System.Data.Common.DbConnectionStringBuilder.System#ComponentModel#ICustomTypeDescriptor#GetDefaultProperty</property>
+ </attribute>
+ <attribute fullname="System.Diagnostics.CodeAnalysis.UnconditionalSuppressMessageAttribute">
+ <argument>ILLink</argument>
+ <argument>IL2026</argument>
+ <property name="Scope">member</property>
+ <property name="Target">M:System.Data.Common.DbConnectionStringBuilder.System#ComponentModel#ICustomTypeDescriptor#GetEditor(System.Type)</property>
+ </attribute>
+ <attribute fullname="System.Diagnostics.CodeAnalysis.UnconditionalSuppressMessageAttribute">
+ <argument>ILLink</argument>
+ <argument>IL2026</argument>
+ <property name="Scope">member</property>
+ <property name="Target">M:System.Data.Common.DbConnectionStringBuilder.System#ComponentModel#ICustomTypeDescriptor#GetEvents</property>
+ </attribute>
+ <attribute fullname="System.Diagnostics.CodeAnalysis.UnconditionalSuppressMessageAttribute">
+ <argument>ILLink</argument>
+ <argument>IL2026</argument>
+ <property name="Scope">member</property>
+ <property name="Target">M:System.Data.XMLSchema.SetProperties(System.Object,System.Xml.XmlAttributeCollection)</property>
+ </attribute>
+ <attribute fullname="System.Diagnostics.CodeAnalysis.UnconditionalSuppressMessageAttribute">
+ <argument>ILLink</argument>
+ <argument>IL2026</argument>
+ <property name="Scope">member</property>
+ <property name="Target">M:System.Data.XmlTreeGen.AddXdoProperties(System.Object,System.Xml.XmlElement,System.Xml.XmlDocument)</property>
+ </attribute>
+ <attribute fullname="System.Diagnostics.CodeAnalysis.UnconditionalSuppressMessageAttribute">
+ <argument>ILLink</argument>
+ <argument>IL2026</argument>
+ <property name="Scope">member</property>
+ <property name="Target">M:System.Data.XmlTreeGen.AddXdoProperty(System.ComponentModel.PropertyDescriptor,System.Object,System.Xml.XmlElement,System.Xml.XmlDocument)</property>
+ </attribute>
+ <attribute fullname="System.Diagnostics.CodeAnalysis.UnconditionalSuppressMessageAttribute">
+ <argument>ILLink</argument>
+ <argument>IL2026</argument>
+ <property name="Scope">member</property>
+ <property name="Target">M:System.Data.XSDSchema.SetExtProperties(System.Object,System.Xml.XmlAttribute[])</property>
+ </attribute>
+ <attribute fullname="System.Diagnostics.CodeAnalysis.UnconditionalSuppressMessageAttribute">
+ <argument>ILLink</argument>
+ <argument>IL2026</argument>
+ <property name="Scope">member</property>
+ <property name="Target">M:System.Data.XSDSchema.SetExtProperties(System.Object,System.Xml.XmlAttributeCollection)</property>
+ </attribute>
+ <attribute fullname="System.Diagnostics.CodeAnalysis.UnconditionalSuppressMessageAttribute">
+ <argument>ILLink</argument>
+ <argument>IL2026</argument>
+ <property name="Scope">member</property>
+ <property name="Target">M:System.Data.XSDSchema.SetProperties(System.Object,System.Xml.XmlAttribute[])</property>
+ </attribute>
+ <attribute fullname="System.Diagnostics.CodeAnalysis.UnconditionalSuppressMessageAttribute">
+ <argument>ILLink</argument>
+ <argument>IL2067</argument>
+ <property name="Scope">member</property>
+ <property name="Target">M:System.Data.XMLSchema.GetConverter(System.Type)</property>
+ </attribute>
</assembly>
</linker>
using System.ComponentModel;
using System.Data.ProviderBase;
using System.Diagnostics;
+using System.Diagnostics.CodeAnalysis;
namespace System.Data.Common
{
return new EventDescriptorCollection(null);
}
+ [RequiresUnreferencedCode("The public parameterless constructor or the 'Default' static field may be trimmed from the Attribute's Type.")]
EventDescriptorCollection ICustomTypeDescriptor.GetEvents(Attribute[] attributes)
{
return new EventDescriptorCollection(null);
}
+ [UnconditionalSuppressMessage("ReflectionAnalysis", "IL2026:RequiresUnreferencedCode", Justification = "No Attributes are supplied.")]
PropertyDescriptorCollection ICustomTypeDescriptor.GetProperties()
{
return ((ICustomTypeDescriptor)this).GetProperties(null);
}
+ [RequiresUnreferencedCode("The public parameterless constructor or the 'Default' static field may be trimmed from the Attribute's Type.")]
PropertyDescriptorCollection ICustomTypeDescriptor.GetProperties(Attribute[] attributes)
{
if (_propertyDescriptors == null)
}
}
+ [RequiresUnreferencedCode("The public parameterless constructor or the 'Default' static field may be trimmed from the Attribute's Type.")]
private PropertyDescriptorCollection GetProperties(Attribute[]? attributes)
{
PropertyDescriptorCollection propertyDescriptors = GetProperties();
{
return GetProperties();
}
+ [RequiresUnreferencedCode("The public parameterless constructor or the 'Default' static field may be trimmed from the Attribute's Type.")]
PropertyDescriptorCollection ICustomTypeDescriptor.GetProperties(Attribute[] attributes)
{
return GetProperties(attributes);
{
return TypeDescriptor.GetEvents(this, true);
}
+ [RequiresUnreferencedCode("The public parameterless constructor or the 'Default' static field may be trimmed from the Attribute's Type.")]
EventDescriptorCollection ICustomTypeDescriptor.GetEvents(Attribute[] attributes)
{
return TypeDescriptor.GetEvents(this, attributes, true);
// The .NET Foundation licenses this file to you under the MIT license.
using System.ComponentModel;
+using System.Diagnostics.CodeAnalysis;
namespace System.Data.Common
{
EventDescriptorCollection ICustomTypeDescriptor.GetEvents() => new EventDescriptorCollection(null);
+ [RequiresUnreferencedCode("The public parameterless constructor or the 'Default' static field may be trimmed from the Attribute's Type.")]
EventDescriptorCollection ICustomTypeDescriptor.GetEvents(Attribute[] attributes) => new EventDescriptorCollection(null);
+ [UnconditionalSuppressMessage("ReflectionAnalysis", "IL2026:RequiresUnreferencedCode", Justification = "No Attributes are supplied.")]
PropertyDescriptorCollection ICustomTypeDescriptor.GetProperties() =>
((ICustomTypeDescriptor)this).GetProperties(null);
+ [RequiresUnreferencedCode("The public parameterless constructor or the 'Default' static field may be trimmed from the Attribute's Type.")]
PropertyDescriptorCollection ICustomTypeDescriptor.GetProperties(Attribute[] attributes) =>
new PropertyDescriptorCollection(null);
PropertyDescriptor ICustomTypeDescriptor.GetDefaultProperty() => null;
object ICustomTypeDescriptor.GetEditor(Type editorBaseType) => null;
EventDescriptorCollection ICustomTypeDescriptor.GetEvents() => new EventDescriptorCollection(null);
+
+ [RequiresUnreferencedCode("The public parameterless constructor or the 'Default' static field may be trimmed from the Attribute's Type.")]
EventDescriptorCollection ICustomTypeDescriptor.GetEvents(Attribute[] attributes) => new EventDescriptorCollection(null);
+
+ [UnconditionalSuppressMessage("ReflectionAnalysis", "IL2026:RequiresUnreferencedCode", Justification = "No Attributes are supplied.")]
PropertyDescriptorCollection ICustomTypeDescriptor.GetProperties() => ((ICustomTypeDescriptor)this).GetProperties(null);
+
+ [RequiresUnreferencedCode("The public parameterless constructor or the 'Default' static field may be trimmed from the Attribute's Type.")]
PropertyDescriptorCollection ICustomTypeDescriptor.GetProperties(Attribute[] attributes) =>
(_dataView.Table != null ? _dataView.Table.GetPropertyDescriptorCollection(attributes) : s_zeroPropertyDescriptorCollection);
+
object ICustomTypeDescriptor.GetPropertyOwner(PropertyDescriptor pd) => this;
#nullable enable
#endregion
#nullable disable
using System.ComponentModel;
+using System.Diagnostics.CodeAnalysis;
namespace System.Data
{
/// additional events. The returned array of events will be
/// filtered by the given set of attributes.
/// </summary>
+ [RequiresUnreferencedCode("The public parameterless constructor or the 'Default' static field may be trimmed from the Attribute's Type.")]
EventDescriptorCollection ICustomTypeDescriptor.GetEvents(Attribute[] attributes) =>
new EventDescriptorCollection(null);
/// provides. If the component is sited, the site may add or remove
/// additional properties.
/// </summary>
+ [UnconditionalSuppressMessage("ReflectionAnalysis", "IL2026:RequiresUnreferencedCode", Justification = "No Attributes are supplied.")]
PropertyDescriptorCollection ICustomTypeDescriptor.GetProperties() =>
((ICustomTypeDescriptor)this).GetProperties(null);
/// additional properties. The returned array of properties will be
/// filtered by the given set of attributes.
/// </summary>
+ [RequiresUnreferencedCode("The public parameterless constructor or the 'Default' static field may be trimmed from the Attribute's Type.")]
PropertyDescriptorCollection ICustomTypeDescriptor.GetProperties(Attribute[] attributes)
{
if (_propsCollection == null)
return;
}
- if ((!pd.ShouldSerializeValue(instance) || !pd.Attributes.Contains(DesignerSerializationVisibilityAttribute.Visible)) && (bIsSqlType == false))
+ if ((!pd.ShouldSerializeValue(instance) || !ContainsDesignerSerializationVisibleAttribute(pd)) && (bIsSqlType == false))
{
return;
}
return;
}
+ [DynamicDependency(DynamicallyAccessedMemberTypes.PublicParameterlessConstructor | DynamicallyAccessedMemberTypes.PublicFields, typeof(DesignerSerializationVisibilityAttribute))]
+ [UnconditionalSuppressMessage("ReflectionAnalysis", "IL2026:RequiresUnreferencedCode", Justification = "The DynamicDependency ensures the correct members are preserved.")]
+ private bool ContainsDesignerSerializationVisibleAttribute(PropertyDescriptor pd) => pd.Attributes.Contains(DesignerSerializationVisibilityAttribute.Visible);
+
internal static string XmlDataTypeName(Type type)
{
if (type == typeof(char))