1 write to EnumType
System.ComponentModel.TypeConverter (1)
System\ComponentModel\EnumConverter.cs (1)
31
EnumType
= type;
26 references to EnumType
System.ComponentModel.TypeConverter (26)
System\ComponentModel\EnumConverter.cs (26)
88
bool isUnderlyingTypeUInt64 = Enum.GetUnderlyingType(
EnumType
) == typeof(ulong);
93
convertedValue |= GetEnumValue(isUnderlyingTypeUInt64, Enum.Parse(
EnumType
, v, true), culture);
95
return Enum.ToObject(
EnumType
, convertedValue);
99
return Enum.Parse(
EnumType
, strValue, true);
104
throw new FormatException(SR.Format(SR.ConvertInvalidPrimitive, (string)value,
EnumType
.Name), e);
109
bool isUnderlyingTypeUInt64 = Enum.GetUnderlyingType(
EnumType
) == typeof(ulong);
115
return Enum.ToObject(
EnumType
, finalValue);
131
if (!
EnumType
.IsDefined(typeof(FlagsAttribute), false) && !Enum.IsDefined(
EnumType
, value))
133
throw new ArgumentException(SR.Format(SR.EnumConverterInvalidValue, value,
EnumType
.Name));
136
return Enum.Format(
EnumType
, value, "G");
143
if (
EnumType
.IsDefined(typeof(FlagsAttribute), false) && enumName.Contains(','))
150
Type underlyingType = Enum.GetUnderlyingType(
EnumType
);
158
return new InstanceDescriptor(method, new object[] {
EnumType
, convertedValue });
165
FieldInfo? GetEnumField(string name) =>
EnumType
.GetField(name);
177
if (
EnumType
.IsDefined(typeof(FlagsAttribute), false))
179
bool isUnderlyingTypeUInt64 = Enum.GetUnderlyingType(
EnumType
) == typeof(ulong);
182
Array objValues = Enum.GetValuesAsUnderlyingType(
EnumType
);
198
flagValues.Add((Enum)Enum.ToObject(
EnumType
, ul));
213
flagValues.Add((Enum)Enum.ToObject(
EnumType
, longValue));
220
return new Enum[] { (Enum)Enum.ToObject(
EnumType
, value) };
244
Type _reflectType = GetTypeDescriptorReflectionType(
EnumType
);
252
fields = GetPublicStaticEnumFields(
EnumType
);
284
value = Enum.Parse(
EnumType
, field.Name);
319
return !
EnumType
.IsDefined(typeof(FlagsAttribute), false);
331
public override bool IsValid(ITypeDescriptorContext? context, object? value) => Enum.IsDefined(
EnumType
, value!);