mirror of https://github.com/dahall/Vanara.git
Corrected build warnings related to RequiresUnreferencedCodeAttribute
parent
46aca17c9f
commit
76087b0ab5
|
@ -2,6 +2,7 @@
|
|||
using System.Collections;
|
||||
using System.ComponentModel;
|
||||
using System.ComponentModel.Design.Serialization;
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
using System.Drawing;
|
||||
using System.Globalization;
|
||||
using System.Reflection;
|
||||
|
@ -230,6 +231,9 @@ namespace Vanara.PInvoke
|
|||
|
||||
public override bool GetCreateInstanceSupported(ITypeDescriptorContext context) => true;
|
||||
|
||||
#if NET6_0_OR_GREATER
|
||||
[RequiresUnreferencedCode(null)]
|
||||
#endif
|
||||
public override PropertyDescriptorCollection GetProperties(ITypeDescriptorContext context, object value, Attribute[] attributes)
|
||||
{
|
||||
PropertyDescriptorCollection props = TypeDescriptor.GetProperties(typeof(POINT), attributes);
|
||||
|
|
|
@ -405,6 +405,9 @@ namespace Vanara.PInvoke
|
|||
throw new ArgumentException(@"Invalid property value.");
|
||||
}
|
||||
|
||||
#if NET6_0_OR_GREATER
|
||||
[RequiresUnreferencedCode(null)]
|
||||
#endif
|
||||
public override PropertyDescriptorCollection GetProperties(ITypeDescriptorContext context, object value, Attribute[] attributes)
|
||||
{
|
||||
var props = TypeDescriptor.GetProperties(typeof(PRECT), attributes);
|
||||
|
@ -478,6 +481,9 @@ namespace Vanara.PInvoke
|
|||
|
||||
public override bool GetCreateInstanceSupported(ITypeDescriptorContext context) => true;
|
||||
|
||||
#if NET6_0_OR_GREATER
|
||||
[RequiresUnreferencedCode(null)]
|
||||
#endif
|
||||
public override PropertyDescriptorCollection GetProperties(ITypeDescriptorContext context, object value, Attribute[] attributes)
|
||||
{
|
||||
var props = TypeDescriptor.GetProperties(typeof(RECT), attributes);
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
using System;
|
||||
using System.ComponentModel;
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
using System.Globalization;
|
||||
|
||||
namespace Vanara.Windows.Forms
|
||||
|
@ -10,6 +11,9 @@ namespace Vanara.Windows.Forms
|
|||
public override object ConvertTo(ITypeDescriptorContext context, CultureInfo culture, object value, Type destinationType) =>
|
||||
destinationType == typeof(string) ? string.Empty : base.ConvertTo(context, culture, value, destinationType);
|
||||
|
||||
#if NET6_0_OR_GREATER
|
||||
[RequiresUnreferencedCode(null)]
|
||||
#endif
|
||||
public override PropertyDescriptorCollection GetProperties(ITypeDescriptorContext context, object value, Attribute[] attributes) =>
|
||||
TypeDescriptor.GetProperties(value, attributes);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue