<PackageReference Include="System.Drawing.Common" Version="10.0.0-rc.2.25502.107" />

FontConverter

public class FontConverter : TypeConverter
Converts Font objects from one data type to another.
using System.Collections; using System.ComponentModel; using System.Diagnostics.CodeAnalysis; using System.Globalization; using System.Runtime.CompilerServices; namespace System.Drawing { [System.Runtime.CompilerServices.NullableContext(2)] [System.Runtime.CompilerServices.Nullable(0)] public class FontConverter : TypeConverter { [System.Runtime.CompilerServices.Nullable(0)] public sealed class FontNameConverter : TypeConverter, IDisposable { public FontNameConverter() { throw new PlatformNotSupportedException(System.SR.SystemDrawingCommon_PlatformNotSupported); } [System.Runtime.CompilerServices.NullableContext(1)] public override bool CanConvertFrom([System.Runtime.CompilerServices.Nullable(2)] ITypeDescriptorContext context, Type sourceType) { throw new PlatformNotSupportedException(System.SR.SystemDrawingCommon_PlatformNotSupported); } public override object ConvertFrom(ITypeDescriptorContext context, CultureInfo culture, [System.Runtime.CompilerServices.Nullable(1)] object value) { throw new PlatformNotSupportedException(System.SR.SystemDrawingCommon_PlatformNotSupported); } [System.Runtime.CompilerServices.NullableContext(1)] public override StandardValuesCollection GetStandardValues([System.Runtime.CompilerServices.Nullable(2)] ITypeDescriptorContext context) { throw new PlatformNotSupportedException(System.SR.SystemDrawingCommon_PlatformNotSupported); } public override bool GetStandardValuesExclusive(ITypeDescriptorContext context) { throw new PlatformNotSupportedException(System.SR.SystemDrawingCommon_PlatformNotSupported); } public override bool GetStandardValuesSupported(ITypeDescriptorContext context) { throw new PlatformNotSupportedException(System.SR.SystemDrawingCommon_PlatformNotSupported); } void IDisposable.Dispose() { } } [System.Runtime.CompilerServices.NullableContext(0)] public class FontUnitConverter : EnumConverter { public FontUnitConverter() : base(null) { throw new PlatformNotSupportedException(System.SR.SystemDrawingCommon_PlatformNotSupported); } [System.Runtime.CompilerServices.NullableContext(1)] public override StandardValuesCollection GetStandardValues([System.Runtime.CompilerServices.Nullable(2)] ITypeDescriptorContext context) { throw new PlatformNotSupportedException(System.SR.SystemDrawingCommon_PlatformNotSupported); } } public FontConverter() { throw new PlatformNotSupportedException(System.SR.SystemDrawingCommon_PlatformNotSupported); } [System.Runtime.CompilerServices.NullableContext(1)] public override bool CanConvertFrom([System.Runtime.CompilerServices.Nullable(2)] ITypeDescriptorContext context, Type sourceType) { throw new PlatformNotSupportedException(System.SR.SystemDrawingCommon_PlatformNotSupported); } public override bool CanConvertTo(ITypeDescriptorContext context, [System.Diagnostics.CodeAnalysis.NotNullWhen(true)] Type destinationType) { throw new PlatformNotSupportedException(System.SR.SystemDrawingCommon_PlatformNotSupported); } public override object ConvertFrom(ITypeDescriptorContext context, CultureInfo culture, [System.Runtime.CompilerServices.Nullable(1)] object value) { throw new PlatformNotSupportedException(System.SR.SystemDrawingCommon_PlatformNotSupported); } public override object ConvertTo(ITypeDescriptorContext context, CultureInfo culture, object value, [System.Runtime.CompilerServices.Nullable(1)] Type destinationType) { throw new PlatformNotSupportedException(System.SR.SystemDrawingCommon_PlatformNotSupported); } [System.Runtime.CompilerServices.NullableContext(1)] public override object CreateInstance([System.Runtime.CompilerServices.Nullable(2)] ITypeDescriptorContext context, IDictionary propertyValues) { throw new PlatformNotSupportedException(System.SR.SystemDrawingCommon_PlatformNotSupported); } public override bool GetCreateInstanceSupported(ITypeDescriptorContext context) { throw new PlatformNotSupportedException(System.SR.SystemDrawingCommon_PlatformNotSupported); } [System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("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 PropertyDescriptorCollection GetProperties(ITypeDescriptorContext context, object value, [System.Runtime.CompilerServices.Nullable(new byte[] { 2, 1 })] Attribute[] attributes) { throw new PlatformNotSupportedException(System.SR.SystemDrawingCommon_PlatformNotSupported); } public override bool GetPropertiesSupported(ITypeDescriptorContext context) { throw new PlatformNotSupportedException(System.SR.SystemDrawingCommon_PlatformNotSupported); } } }