671 references to Enum
ComSvcConfig (2)
Options.cs (2)
221if (string.Equals(argValue, Enum.GetName(typeof(Hosting), Hosting.Complus), StringComparison.OrdinalIgnoreCase)) 225else if (string.Equals(argValue, Enum.GetName(typeof(Hosting), Hosting.Was), StringComparison.OrdinalIgnoreCase))
mscorlib (144)
microsoft\win32\registrykey.cs (2)
1404else if (!Enum.IsDefined(typeof(RegistryValueKind), type)) 1466if (!Enum.IsDefined(typeof(RegistryValueKind), valueKind))
system\cfgparser.cs (1)
312BCLDebug.Trace("REMOTE", "NotifyEvent "+((Enum)nEvent).ToString()+"\n");
system\collections\generic\equalitycomparer.cs (2)
62TypeCode underlyingTypeCode = Type.GetTypeCode(Enum.GetUnderlyingType(t)); 407if (Type.GetTypeCode(Enum.GetUnderlyingType(typeof(T))) != TypeCode.Int32) {
system\convert.cs (2)
138private static readonly RuntimeType EnumType = (RuntimeType)typeof(Enum); 311return (Enum)value;
system\diagnostics\eventing\eventprovider.cs (2)
839if (data is System.Enum) 841Type underlyingType = Enum.GetUnderlyingType(data.GetType());
system\diagnostics\eventing\eventsource.cs (5)
1866dataType = Enum.GetUnderlyingType(dataType); 3190value = Enum.Parse(p.PropertyType, value.ToString()); 6233if (type.IsEnum() && Enum.GetUnderlyingType(type) != typeof(UInt64) && Enum.GetUnderlyingType(type) != typeof(Int64)) 6352if (Enum.IsDefined(typeof(EventChannelType), attribs.EventChannelType))
System\Diagnostics\Eventing\TraceLogging\Statics.cs (1)
670var underlyingType = Enum.GetUnderlyingType(dataType);
system\enum.cs (4)
638value = ((Enum)value).GetValue(); 735private extern bool InternalHasFlag(Enum flags); 802return Enum.InternalFormat((RuntimeType)GetType(), GetValue()); 877public Boolean HasFlag(Enum flag) {
system\environment.cs (3)
1446if (!Enum.IsDefined(typeof(SpecialFolder), folder)) 1457if (!Enum.IsDefined(typeof(SpecialFolder),folder)) 1459if (!Enum.IsDefined(typeof(SpecialFolderOption),option))
system\oleautbinder.cs (1)
61return Enum.Parse(type, value.ToString());
system\reflection\assembly.cs (2)
2820webArgs[0] = (Enum) Enum.Parse(type, "Connect", true);
system\reflection\customattribute.cs (4)
272if (type == (RuntimeType)typeof(Enum)) 301encodedEnumType = TypeToCustomAttributeEncoding((RuntimeType)Enum.GetUnderlyingType(parameterType)); 698return typeof(Enum); 842return ((Enum)value).GetValue();
system\reflection\emit\constructorbuilder.cs (1)
231if (!Enum.IsDefined(typeof(SecurityAction), action) ||
system\reflection\emit\customattributebuilder.cs (2)
79switch (Type.GetTypeCode(Enum.GetUnderlyingType(t))) 389switch (Type.GetTypeCode(Enum.GetUnderlyingType(type)))
system\reflection\emit\enumbuilder.cs (1)
413m_typeBuilder = new TypeBuilder(name, visibility | TypeAttributes.Sealed, typeof(System.Enum), null, module, PackingSize.Unspecified, TypeBuilder.UnspecifiedTypeSize, null);
system\reflection\emit\methodbuilder.cs (1)
931if (!Enum.IsDefined(typeof(SecurityAction), action) ||
system\reflection\emit\opcode.cs (1)
270name = Enum.GetName(typeof(OpCodeValues), opCodeValue).ToLowerInvariant().Replace("_", ".");
system\reflection\emit\typebuilder.cs (2)
460underlyingType = Enum.GetUnderlyingType(destType); 2551if (!Enum.IsDefined(typeof(SecurityAction), action) ||
system\resources\neutralresourceslanguageattribute.cs (1)
51if (!Enum.IsDefined(typeof(UltimateResourceFallbackLocation), location))
system\resources\resourcereader.cs (1)
1140if (resourceType.BaseType == typeof(Enum)) {
system\resources\resourcewriter.cs (1)
576ResourceTypeCode typeCode = (ResourceTypeCode)Enum.Parse(typeof(ResourceTypeCode), typeName);
system\rttype.cs (14)
2713internal static readonly RuntimeType EnumType = (RuntimeType)typeof(System.Enum); 3631typeCode = Type.GetTypeCode(Enum.GetUnderlyingType(this)); 3977if (this == typeof(ValueType) || this == typeof(Enum)) 4065String[] ret = Enum.InternalGetNames(this); 4083ulong[] values = Enum.InternalGetValues(this); 4090Object val = Enum.ToObject(this, values[i]); 4103return Enum.InternalGetUnderlyingType(this); 4128string[] names = Enum.InternalGetNames(this); 4138RuntimeType underlyingType = Enum.InternalGetUnderlyingType(this); 4142ulong[] ulValues = Enum.InternalGetValues(this); 4143ulong ulValue = Enum.ToUInt64(value); 4170ulong[] ulValues = Enum.InternalGetValues(this); 4171ulong ulValue = Enum.ToUInt64(value); 4176string[] names = Enum.InternalGetNames(this);
system\Runtime\InteropServices\ComEventsMethod.cs (1)
65args[i] = Enum.ToObject(_cachedTargetTypes[i], args[i]);
system\runtime\remoting\lease.cs (13)
110throw new RemotingException(Environment.GetResourceString("Remoting_Lifetime_InitialStateRenewOnCall", ((Enum)state).ToString())); 128throw new RemotingException(Environment.GetResourceString("Remoting_Lifetime_InitialStateSponsorshipTimeout", ((Enum)state).ToString())); 146BCLDebug.Trace("REMOTE", "Lease Set InitialLeaseTime Property ",managedObject," "+InitialLeaseTime+", current state "+((Enum)state).ToString()); 149throw new RemotingException(Environment.GetResourceString("Remoting_Lifetime_InitialStateInitialLeaseTime", ((Enum)state).ToString())); 179BCLDebug.Trace("REMOTE", "Lease "+id+" Register Sponsor renewalTime ",renewalTime," state ",((Enum)state).ToString()); 203BCLDebug.Trace("REMOTE", "Lease",id," Unregister state ",((Enum)state).ToString()); 261BCLDebug.Trace("REMOTE","Lease ",id," Renew ",renewalTime," state ",((Enum)state).ToString()); 272BCLDebug.Trace("REMOTE","Lease ",id," Remove state ",((Enum)state).ToString()); 284BCLDebug.Trace("REMOTE","Lease ",id," Cancel Managed Object ",managedObject," state ",((Enum)state).ToString()); 326BCLDebug.Trace("REMOTE","Lease ",id," LeaseExpired state ",((Enum)state).ToString()); 347BCLDebug.Trace("REMOTE","Lease ",id," SponsorCall state ",((Enum)state).ToString()); 401BCLDebug.Trace("REMOTE","Lease ",id," SponsorTimeout sponsorState ",((Enum)sponsorStateInfo.sponsorState).ToString()); 464BCLDebug.Trace("REMOTE","Lease ",id," SponsorCallback IAsyncResult ",iar," state ",((Enum)state).ToString());
system\runtime\serialization\formatters\binary\binarycommonclasses.cs (20)
99SerTrace.Log( "BinaryConverter", "GetBinaryTypeInfo Exit ",((Enum)binaryTypeEnum).ToString(),", typeInformation ",typeInformation," assemId ",assemId); 141SerTrace.Log( "BinaryConverter", "GetParserBinaryTypeInfo Exit ",((Enum)binaryTypeEnum).ToString(),", typeInformation ",typeInformation); 148SerTrace.Log( "BinaryConverter", "WriteTypeInfo Entry ",((Enum)binaryTypeEnum).ToString()," ",typeInformation," assemId ",assemId); 172throw new SerializationException(Environment.GetResourceString("Serialization_TypeWrite",((Enum)binaryTypeEnum).ToString())); 180SerTrace.Log( "BinaryConverter", "ReadTypeInfo Entry ",((Enum)binaryTypeEnum).ToString()); 203throw new SerializationException(Environment.GetResourceString("Serialization_TypeRead",((Enum)binaryTypeEnum).ToString())); 221SerTrace.Log( "BinaryConverter", "TypeFromInfo Entry ",((Enum)binaryTypeEnum).ToString()); 268throw new SerializationException(Environment.GetResourceString("Serialization_TypeRead",((Enum)binaryTypeEnum).ToString())); 485BinaryUtil.NVTraceI("binaryHeaderEnum (Byte)", ((Enum)binaryHeaderEnum).ToString()); 873BinaryUtil.NVTraceI("messageEnum (Int32)", ((Enum)messageEnum).ToString()); 1153BinaryUtil.NVTraceI("messageEnum (Int32)", ((Enum)messageEnum).ToString()); 1324SerTrace.Log(this, "MemberPrimitiveTyped Set ",((Enum)primitiveTypeEnum).ToString()," ",value); 1356BinaryUtil.NVTraceI("primitiveTypeEnum (Byte)", ((Enum)primitiveTypeEnum).ToString()); 1444BinaryUtil.NVTraceI("binaryHeaderEnum (Byte)", ((Enum)binaryHeaderEnum).ToString()); 1633SerTrace.Log( this, "BinaryArray Constructor 2 ", ((Enum)binaryHeaderEnum).ToString()); 1640SerTrace.Log( this, "BinaryArray Set objectId ",objectId," rank ",rank," ",((Enum)binaryTypeEnum).ToString(),", assemId ",assemId); 1660SerTrace.Log( this, "BinaryArray Set Exit ",((Enum)binaryHeaderEnum).ToString()); 1923BinaryUtil.NVTraceI("binaryHeaderEnum (Byte)", ((Enum)BinaryHeaderEnum.MemberReference).ToString()); 2299SerTrace.Log( this, "GetNext Array Exit ",((Enum)outBinaryTypeEnum).ToString()," ",outTypeInformation); 2322SerTrace.Log( this, "GetNext Member Exit ",((Enum)outBinaryTypeEnum).ToString()," ",outTypeInformation," memberName ",name);
system\runtime\serialization\formatters\binary\binaryconverter.cs (7)
59SerTrace.Log("Converter", "ToCode Exit " , ((Enum)code).ToString()); 139SerTrace.Log("Converter", "GetNameSpaceEnum Entry ",((Enum)code).ToString()," type ",type); 197SerTrace.Log("Converter", "GetNameSpaceEnum Exit ", ((Enum)nameSpaceEnum).ToString()," typeName ",typeName); 205SerTrace.Log("Converter", "ToType Entry ", ((Enum)code).ToString()); 267SerTrace.Log("Converter", "ToType Entry ", ((Enum)code).ToString()); 394SerTrace.Log("Converter", "ToComType Entry ", ((Enum)code).ToString()); 478SerTrace.Log( "Converter", "FromString Entry ",value," " , ((Enum)code).ToString());
system\runtime\serialization\formatters\binary\binaryformatterwriter.cs (3)
302,memberNames[i],", memberType ",memberTypes[i]," binaryTypeEnum ",((Enum)binaryTypeEnumA[i]).ToString() 718SerTrace.Log( this, "WriteValue Entry ",((Enum)code).ToString()," " , ((value==null)?"<null>":value.GetType().ToString()) , " ",value); 768throw new SerializationException(Environment.GetResourceString("Serialization_TypeCode",((Enum)code).ToString()));
system\runtime\serialization\formatters\binary\binaryobjectreader.cs (4)
424throw new SerializationException(Environment.GetResourceString("Serialization_ParseError",onStack.PRname+" "+((Enum)onStack.PRparseTypeEnum) + " "+processing.PRname+" "+((Enum)processing.PRparseTypeEnum))); 805throw new SerializationException(Environment.GetResourceString("Serialization_ArrayType",((Enum)pr.PRarrayTypeEnum))); 1010SerTrace.Log( this, "ParseArrayMember SetValue Primitive pr.PRvalue "+var," elementTypeCode ",((Enum)objectPr.PRdtTypeCode));
system\runtime\serialization\formatters\binary\binaryobjectwriter.cs (2)
70((Enum)formatterEnums.FEserializerTypeEnum)); 1271SerTrace.Log( this, "TypeToNameInfo Entry type ",type,", objectInfo ",objectInfo,", code ", ((Enum)code).ToString());
system\runtime\serialization\formatters\binary\binaryparser.cs (12)
114SerTrace.Log( this, "Run loop ",((Enum)expectedType).ToString()); 218SerTrace.Log( this, "Run loop opName ",op.name,", expectedType ",((Enum)expectedType).ToString()," expectedTypeInformation, ",expectedTypeInformation); 494throw new SerializationException(Environment.GetResourceString("Serialization_Map",((Enum)objectOp.objectTypeEnum).ToString())); 625throw new SerializationException(Environment.GetResourceString("Serialization_ObjectTypeEnum",((Enum)objectOp.objectTypeEnum).ToString())); 720throw new SerializationException(Environment.GetResourceString("Serialization_ObjectTypeEnum",((Enum)objectOp.objectTypeEnum).ToString())); 807throw new SerializationException(Environment.GetResourceString("Serialization_ObjectTypeEnum",((Enum)objectOp.objectTypeEnum).ToString())); 864throw new SerializationException(Environment.GetResourceString("Serialization_ObjectTypeEnum",((Enum)objectOp.objectTypeEnum).ToString())); 931throw new SerializationException(Environment.GetResourceString("Serialization_ObjectTypeEnum",((Enum)objectOp.objectTypeEnum).ToString())); 985throw new SerializationException(Environment.GetResourceString("Serialization_ArrayType",((Enum)record.binaryArrayTypeEnum).ToString())); 995SerTrace.Log( this, "ReadArray ",((Enum)record.binaryArrayTypeEnum).ToString()," length ",op.numItems); 1179SerTrace.Log( this, "ReadValue ",((Enum)code).ToString()); 1230throw new SerializationException(Environment.GetResourceString("Serialization_TypeCode",((Enum)code).ToString()));
system\security\permissions\filedialogpermission.cs (2)
87access = (FileDialogPermissionAccess)Enum.Parse(typeof(FileDialogPermissionAccess), accessXml); 166esd.AddAttribute("Access", Enum.GetName(typeof(FileDialogPermissionAccess), access));
system\security\permissions\hostprotectionpermission.cs (1)
283Resources = (HostProtectionResource)Enum.Parse( typeof( HostProtectionResource ), resources );
system\security\permissions\isolatedstoragepermission.cs (2)
210esd.AddAttribute( "Allowed", Enum.GetName( typeof( IsolatedStorageContainment ), m_allowed ) ); 251m_allowed = (IsolatedStorageContainment)Enum.Parse( typeof( IsolatedStorageContainment ), allowed );
system\security\permissions\keycontainerpermission.cs (2)
570KeyContainerPermissionFlags flags = (KeyContainerPermissionFlags) Enum.Parse(typeof(KeyContainerPermissionFlags), strFlags); 627flags = (KeyContainerPermissionFlags) Enum.Parse(typeof(KeyContainerPermissionFlags), strAttrValue);
system\security\permissions\reflectionpermission.cs (1)
304m_flags = (ReflectionPermissionFlag)Enum.Parse( typeof( ReflectionPermissionFlag ), flags );
system\security\permissions\securitypermission.cs (1)
311m_flags = (SecurityPermissionFlag)Enum.Parse( typeof( SecurityPermissionFlag ), flags );
system\security\permissions\uipermission.cs (4)
327esd.AddAttribute( "Window", Enum.GetName( typeof( UIPermissionWindow ), m_windowFlag ) ); 331esd.AddAttribute( "Clipboard", Enum.GetName( typeof( UIPermissionClipboard ), m_clipboardFlag ) ); 355m_windowFlag = (UIPermissionWindow)Enum.Parse( typeof( UIPermissionWindow ), window ); 359m_clipboardFlag = (UIPermissionClipboard)Enum.Parse( typeof( UIPermissionClipboard ), clipboard );
system\security\permissions\zoneidentitypermission.cs (4)
257esd.AddAttribute( "Zone", Enum.GetName( typeof( SecurityZone ), this.SecurityZone ) ); 268child.AddAttribute( "Zone", Enum.GetName( typeof( SecurityZone ), (SecurityZone)nEnum ) ); 283SecurityZone = (SecurityZone)Enum.Parse( typeof( SecurityZone ), eZone ); 289int enm = (int)Enum.Parse( typeof( SecurityZone ), eZone );
system\security\permissiontoken.cs (1)
319this.m_type = (PermissionTokenType) Enum.Parse(typeof(PermissionTokenType), elRoot.Attribute("Type"));
system\security\policy\filecodegroup.cs (1)
185m_access = (FileIOPermissionAccess) Enum.Parse(typeof(FileIOPermissionAccess), access);
system\security\policy\policystatement.cs (2)
376m_attributes = (PolicyStatementAttribute)Enum.Parse( typeof( PolicyStatementAttribute ), strAttributes ); 453m_attributes = (PolicyStatementAttribute)Enum.Parse( typeof( PolicyStatementAttribute ), strAttributes );
system\security\policy\zonemembershipcondition.cs (2)
172root.AddAttribute( "Zone", Enum.GetName( typeof( SecurityZone ), m_zone ) ); 207m_zone = (SecurityZone)Enum.Parse( typeof( SecurityZone ), eZone );
system\security\policymanager.cs (1)
444foreach (SecurityZone zone in Enum.GetValues(typeof(SecurityZone)))
system\security\util\xmlutil.cs (2)
688return Enum.GetName( type, 0 ); 698String sFlag = Enum.GetName( type, flag );
system\type.cs (2)
1566ulArray[i] = Enum.ToUInt64(array.GetValue(i)); 1568ulong ulValue = Enum.ToUInt64(value);
PresentationBuildTasks (2)
BuildTasks\Microsoft\Build\Tasks\Windows\UidManager.cs (1)
93_task = (UidTask)Enum.Parse(typeof(UidTask), _taskAsString);
Framework\System\Windows\SystemResourceKey.cs (1)
394srkId = (SystemResourceKeyID)Enum.Parse(typeof(SystemResourceKeyID), srkField);
PresentationCore (9)
Core\CSharp\MS\Internal\FontFace\CompositeFontParser.cs (1)
349if (Enum.TryParse(_reader.GetAttribute("OS"), out fontFamilyOsVersion)
Core\CSharp\System\Windows\Input\Cursor.cs (1)
385return Enum.GetName(typeof(CursorType), _cursorType);
Core\CSharp\System\Windows\Input\CursorConverter.cs (1)
114CursorType ct = (CursorType)Enum.Parse(typeof(CursorType), text);
Core\CSharp\System\Windows\Input\InputScopeConverter.cs (2)
122sn = (InputScopeNameValue)Enum.Parse(typeof(InputScopeNameValue), stringSource); 158return Enum.GetName(typeof(InputScopeNameValue), ((InputScopeName)inputScope.Names[0]).NameValue);
Core\CSharp\System\Windows\Input\InputScopeNameConverter.cs (2)
109nameValue = (InputScopeNameValue)Enum.Parse(typeof(InputScopeNameValue), stringSource); 144return Enum.GetName(typeof(InputScopeNameValue), inputScopeName.NameValue);
Core\CSharp\System\Windows\Media\KnownColors.cs (1)
178Array knownColorValues = Enum.GetValues(typeof(KnownColor));
Core\CSharp\System\Windows\Media\RequestCachePolicyConverter.cs (1)
89HttpRequestCacheLevel level = (HttpRequestCacheLevel)Enum.Parse(typeof(HttpRequestCacheLevel), s, true);
PresentationFramework (13)
src\Framework\MS\Internal\Controls\StickyNote\StickyNoteAnnotations.cs (1)
87foreach (XmlToken val in Enum.GetValues(typeof(XmlToken)))
src\Framework\System\Windows\Controls\DataGridColumn.cs (1)
1174comboBoxColumn.ItemsSource = Enum.GetValues(propertyType);
src\Framework\System\Windows\FrameworkCompatibilityPreferences.cs (1)
207if (Enum.TryParse(s, true, out value) && value.CompareTo(HandleTwoWayBindingToPropertyWithNonPublicSetter) <= 0)
src\Framework\System\Windows\Markup\Baml2006\Baml2006Reader.cs (1)
2545return Enum.ToObject(type.UnderlyingType, bytes).ToString();
src\Framework\System\Windows\Markup\Baml2006\WpfGeneratedKnownTypes.cs (1)
11596typeof(System.Enum),
src\Framework\System\Windows\Markup\BamlReader.cs (1)
2473if (Enum.IsDefined(typeof(SystemResourceKeyID), (int)memberId))
src\Framework\System\Windows\Markup\BamlRecords.cs (1)
2842_valueObject = Enum.ToObject(propertyType, enumBits);
src\Framework\System\Windows\Markup\Primitives\ElementMarkupObject.cs (2)
957Enum enumValue = value as Enum;
src\Framework\System\Windows\SystemKeyConverter.cs (3)
264return Enum.GetName(typeof(SystemResourceKeyID), id) + "Key"; 274string propName = Enum.GetName(typeof(SystemResourceKeyID), id) + "Key"; 286return Enum.GetName(typeof(SystemResourceKeyID), id);
src\Framework\System\Windows\SystemResourceKey.cs (1)
394srkId = (SystemResourceKeyID)Enum.Parse(typeof(SystemResourceKeyID), srkField);
System (65)
compmod\system\componentmodel\EnumConverter.cs (31)
23/// <para>Provides a type converter to convert <see cref='System.Enum'/> 84if (sourceType == typeof(string) || sourceType == typeof(Enum[])) { 95if (destinationType == typeof(InstanceDescriptor) || destinationType == typeof(Enum[])) { 124convertedValue |= Convert.ToInt64((Enum)Enum.Parse(type, v, true), culture); 126return Enum.ToObject(type, convertedValue); 129return Enum.Parse(type, strValue, true); 136else if (value is Enum[]) { 138foreach(Enum e in (Enum[])value) { 141return Enum.ToObject(type, finalValue); 162Type underlyingType = Enum.GetUnderlyingType(type); 166if (!type.IsDefined(typeof(FlagsAttribute), false) && !Enum.IsDefined(type, value)) { 170return Enum.Format(type, value, "G"); 181Type underlyingType = Enum.GetUnderlyingType(type); 185MethodInfo method = typeof(Enum).GetMethod("ToObject", new Type[] {typeof(Type), underlyingType}); 198if (destinationType == typeof(Enum[]) && value != null) { 200List<Enum> flagValues = new List<Enum>(); 202Array objValues = Enum.GetValues(type); 205ulValues[idx] = Convert.ToInt64((Enum)objValues.GetValue(idx), culture); 208long longValue = Convert.ToInt64((Enum)value, culture); 214flagValues.Add((Enum)Enum.ToObject(type, ul)); 227flagValues.Add((Enum)Enum.ToObject(type, longValue)); 233return new Enum[] {(Enum)Enum.ToObject(type, value)}; 275value = Enum.Parse(type, field.Name); 327return Enum.IsDefined(type, value);
compmod\system\componentmodel\ReflectPropertyDescriptor.cs (2)
188defaultValue = Enum.ToObject(PropertyType, defaultValue); 324defaultValue = Enum.ToObject(PropertyType, defaultValue);
compmod\system\componentmodel\ReflectTypeDescriptionProvider.cs (1)
142temp[typeof(Enum)] = typeof(EnumConverter);
compmod\system\componentmodel\ToolboxItemFilterAttribute.cs (1)
139return filterString + "," + Enum.GetName(typeof(ToolboxItemFilterType), filterType);
compmod\system\diagnostics\SourceSwitch.cs (1)
36SwitchSetting = (int) Enum.Parse(typeof(SourceLevels), Value, true);
compmod\system\diagnostics\TraceSource.cs (3)
89internalSwitch.Level = (SourceLevels) Enum.Parse(typeof(SourceLevels), sourceElement.SwitchValue); 193internalSwitch.Level = (SourceLevels) Enum.Parse(typeof(SourceLevels), sourceElement.SwitchValue); 206internalSwitch.Level = (SourceLevels) Enum.Parse(typeof(SourceLevels), sourceElement.SwitchValue);
compmod\system\diagnostics\TraceSwitch.cs (1)
113SwitchSetting = (int) Enum.Parse(typeof(TraceLevel), Value, true);
compmod\system\diagnostics\traceutils.cs (1)
126return Enum.Parse(type, value, false);
compmod\system\security\permissions\AspNetHostingPermission.cs (2)
228_level = (AspNetHostingPermissionLevel) Enum.Parse(typeof(AspNetHostingPermissionLevel), level); 239securityElement.AddAttribute("Level", Enum.GetName(typeof(AspNetHostingPermissionLevel), _level));
compmod\system\security\permissions\ResourcePermissionBase.cs (2)
505permissionAccess = (int) Enum.Parse(PermissionAccessType, accessString); 631accessString = Enum.Format(PermissionAccessType, currentAccess, "g");
misc\ClientUtils.cs (5)
68public static bool IsEnumValid(Enum enumValue, int value, int minValue, int maxValue) 85public static bool IsEnumValid(Enum enumValue, int value, int minValue, int maxValue, int maxNumberOfBitsOn) { 105public static bool IsEnumValid_Masked(Enum enumValue, int value, UInt32 mask) { 133public static bool IsEnumValid_NotSequential(System.Enum enumValue, int value, params int[] enumValues) { 134System.Diagnostics.Debug.Assert(Enum.GetValues(enumValue.GetType()).Length == enumValues.Length, "Not all the enum members were passed in.");
net\System\Net\_NetworkingPerfCounters.cs (1)
198Debug.Assert(counterNames.Length == Enum.GetValues(typeof(NetworkingPerfCounterName)).Length,
net\System\Net\Configuration\UriSectionReader.cs (2)
167sectionData.IdnScope = (UriIdnScope)Enum.Parse(typeof(UriIdnScope), attributeValue, true); 238GenericUriParserOptions genericUriParserOptions = (GenericUriParserOptions)Enum.Parse(
net\System\Net\Configuration\WebUtilityElement.cs (1)
69if (Enum.TryParse(s, true /* ignoreCase */, out result)) {
net\System\Net\SocketPermission.cs (2)
142transport = (TransportType) Enum.Parse(typeof(TransportType), m_transport, true); 537transport = (TransportType) Enum.Parse(typeof(TransportType), tmpStr, true);
security\system\security\permissions\storepermission.cs (1)
136StorePermissionFlags flags = (StorePermissionFlags) Enum.Parse(typeof(StorePermissionFlags), strFlags);
security\system\security\permissions\typedescriptorpermission.cs (1)
210TypeDescriptorPermissionFlags flags = (TypeDescriptorPermissionFlags)Enum.Parse(typeof(TypeDescriptorPermissionFlags), strFlags);
services\io\system\io\FileSystemWatcher.cs (1)
104foreach (int enumValue in Enum.GetValues(typeof(NotifyFilters)))
services\monitoring\system\diagnosticts\AlphabeticalEnumConverter.cs (1)
29Array objValues = Enum.GetValues(EnumType);
services\monitoring\system\diagnosticts\CounterCreationData.cs (1)
53if (!Enum.IsDefined(typeof(PerformanceCounterType), value))
services\monitoring\system\diagnosticts\EventData.cs (1)
35if (!Enum.IsDefined(typeof(EventLogEntryType), value))
services\monitoring\system\diagnosticts\EventLogInternal.cs (1)
1622if (!Enum.IsDefined(typeof(EventLogEntryType), type))
services\monitoring\system\diagnosticts\Process.cs (1)
789if (!Enum.IsDefined(typeof(ProcessPriorityClass), value)) {
services\monitoring\system\diagnosticts\ProcessStartInfo.cs (1)
452if (!Enum.IsDefined(typeof(ProcessWindowStyle), value))
System.Activities (2)
System\Activities\Debugger\DebugInfo.cs (1)
416location.Value = Enum.Parse(t, value, true);
System\Activities\Statements\BookmarkTable.cs (1)
15static int tableSize = Enum.GetValues(typeof(CompensationBookmarkName)).Length;
System.Activities.Core.Presentation (1)
System\Activities\Core\Presentation\CaseKeyBox.ViewModel.cs (1)
189this.ComboBoxItems = new ObservableCollection<string>(Enum.GetNames(this.ValueType).ToList());
System.Activities.Presentation (7)
System.Activities.Presentation\System\Activities\Presentation\Base\Core\Internal\PropertyEditing\Editors\FlagPanel.cs (2)
50string zeroValueString = Enum.ToObject(flagType, 0).ToString(); 115return Enum.ToObject(flagType, 0).ToString();
System.Activities.Presentation\System\Activities\Presentation\Base\Core\Internal\PropertyEditing\Editors\FlagStringConverter.cs (3)
34return Enum.ToObject(flagType, 0); 41return Enum.ToObject(flagType, 0); 60return Enum.ToObject(flagType, flagsIntValue);
System.Activities.Presentation\System\Activities\Presentation\Converters\ArgumentToExpressionConverter.cs (1)
42direction = (ArgumentDirection)Enum.Parse(typeof(ArgumentDirection), directionString);
System.Activities.Presentation\System\Activities\Presentation\Converters\ArgumentToExpressionModelItemConverter.cs (1)
51direction = (ArgumentDirection)Enum.Parse(typeof(ArgumentDirection), directionString);
System.ComponentModel.DataAnnotations (6)
DataAnnotations\DataTypeAttribute.cs (1)
114private static string[] _dataTypeStrings = Enum.GetNames(typeof(DataType));
DataAnnotations\EnumDataTypeAttribute.cs (4)
66convertedValue = Enum.Parse(this.EnumType, stringValue, false); 68convertedValue = Enum.ToObject(this.EnumType, value); 85return Enum.IsDefined(this.EnumType, convertedValue); 95return Convert.ChangeType(enumValue, Enum.GetUnderlyingType(enumType), CultureInfo.InvariantCulture).ToString();
DataAnnotations\Schema\DatabaseGeneratedAttribute.cs (1)
15if (!(Enum.IsDefined(typeof(DatabaseGeneratedOption), databaseGeneratedOption))) {
System.Configuration (3)
System\Configuration\GenericEnumConverter.cs (3)
33Debug.Assert(typeof(System.Enum).IsAssignableFrom(value.GetType()), "typeof(System.Enum).IsAssignableFrom(value.GetType())"); 61result = Enum.Parse(_enumType, value); 66foreach (string name in Enum.GetNames(_enumType)) {
System.Core (7)
Microsoft\Scripting\Ast\TypeUtils.cs (2)
183if (instanceType.IsEnum && AreReferenceAssignable(targetType, typeof(System.Enum))) { 593if (source.IsEnum && destination == typeof(System.Enum))
Microsoft\Scripting\Compiler\ILGen.cs (1)
615typeFrom == typeof(System.Enum) ||
System\Diagnostics\PerformanceData\PerfProviderCollection.cs (2)
42private static CounterType[] s_counterTypes = (CounterType[])Enum.GetValues(typeof(CounterType)); 43private static CounterSetInstanceType[] s_counterSetInstanceTypes = (CounterSetInstanceType[])Enum.GetValues(typeof(CounterSetInstanceType));
System\Linq\Parallel\QueryOperators\AssociativeAggregationOperator.cs (1)
89Contract.Assert(Enum.IsDefined(typeof(QueryAggregationOptions), options), "enum out of valid range");
System\Linq\ParallelEnumerable.cs (1)
1583Contract.Assert(Enum.IsDefined(typeof(QueryAggregationOptions), options), "enum is out of range");
System.Data (36)
cdf\src\NetFx40\Tools\System.Activities.Presentation\System\Activities\Presentation\Base\Core\Internal\PropertyEditing\Editors\FlagPanel.cs (2)
50string zeroValueString = Enum.ToObject(flagType, 0).ToString(); 115return Enum.ToObject(flagType, 0).ToString();
cdf\src\NetFx40\Tools\System.Activities.Presentation\System\Activities\Presentation\Base\Core\Internal\PropertyEditing\Editors\FlagStringConverter.cs (3)
34return Enum.ToObject(flagType, 0); 41return Enum.ToObject(flagType, 0); 60return Enum.ToObject(flagType, flagsIntValue);
cdf\src\NetFx40\Tools\System.Activities.Presentation\System\Activities\Presentation\Converters\ArgumentToExpressionConverter.cs (1)
42direction = (ArgumentDirection)Enum.Parse(typeof(ArgumentDirection), directionString);
cdf\src\NetFx40\Tools\System.Activities.Presentation\System\Activities\Presentation\Converters\ArgumentToExpressionModelItemConverter.cs (1)
51direction = (ArgumentDirection)Enum.Parse(typeof(ArgumentDirection), directionString);
fx\src\data\System\Data\Common\DbConnectionStringCommon.cs (11)
333Debug.Assert(Enum.GetNames(typeof(PoolBlockingPeriod)).Length == 3, "PoolBlockingPeriod enum has changed, update needed"); 360Debug.Assert(Enum.GetNames(typeof(PoolBlockingPeriod)).Length == 3, "PoolBlockingPeriod enum has changed, update needed"); 440eValue = (PoolBlockingPeriod)Enum.ToObject(typeof(PoolBlockingPeriod), value); 468Debug.Assert(Enum.GetNames(typeof(ApplicationIntent)).Length == 2, "ApplicationIntent enum has changed, update needed"); 490Debug.Assert(Enum.GetNames(typeof(ApplicationIntent)).Length == 2, "ApplicationIntent enum has changed, update needed"); 565eValue = (ApplicationIntent)Enum.ToObject(typeof(ApplicationIntent), value); 594Debug.Assert(Enum.GetNames(typeof(SqlAuthenticationMethod)).Length == 5, "SqlAuthenticationMethod enum has changed, update needed"); 660Debug.Assert(Enum.GetNames(typeof(SqlConnectionColumnEncryptionSetting)).Length == 2, "SqlConnectionColumnEncryptionSetting enum has changed, update needed"); 684Debug.Assert(Enum.GetNames(typeof(SqlAuthenticationMethod)).Length == 5, "SqlAuthenticationMethod enum has changed, update needed"); 759eValue = (SqlAuthenticationMethod)Enum.ToObject(typeof(SqlAuthenticationMethod), value); 825eValue = (SqlConnectionColumnEncryptionSetting)Enum.ToObject(typeof(SqlConnectionColumnEncryptionSetting), value);
fx\src\data\System\Data\Common\DBDataPermission.cs (1)
303behavior = (KeyRestrictionBehavior) Enum.Parse(typeof(KeyRestrictionBehavior), behavr, true);
fx\src\data\System\Data\DataException.cs (1)
1250return _Data(Res.GetString(Res.DataStorage_InvalidStorageType, ((Enum) typecode).ToString()));
fx\src\data\System\Data\DataTable.cs (1)
2865Debug.Assert(Enum.GetUnderlyingType(typeof(DataRowState)) == typeof(Int32), "Invalid DataRowState type");
fx\src\data\System\Data\DataViewManager.cs (1)
124dataViewSettingsCollection[table].RowStateFilter = (DataViewRowState)Enum.Parse(typeof(DataViewRowState),r.Value);
fx\src\data\System\Data\ForeignKeyConstraint.cs (1)
491Debug.Assert(false, "attempt to cascade unknown action: " + ((Enum) action).ToString());
fx\src\data\System\Data\Merger.cs (2)
435"Unexpected value of MissingSchemaAction parameter : " + ((Enum) missingSchemaAction).ToString()); 519Debug.Assert(MissingSchemaAction.Error == missingSchemaAction, "Unexpected value of MissingSchemaAction parameter : " + ((Enum) missingSchemaAction).ToString());
fx\src\data\System\Data\OleDb\OledbConnectionStringbuilder.cs (4)
690convertedValue |= (int)(OleDbServiceValues)Enum.Parse(typeof(OleDbServiceValues), v, true); 695return (int)(OleDbServiceValues)Enum.Parse(typeof(OleDbServiceValues), svalue, true); 709return Enum.Format(typeof(OleDbServiceValues), ((OleDbServiceValues)(int)value), "G"); 725Array objValues = Enum.GetValues(typeof(OleDbServiceValues));
fx\src\data\System\Data\SqlClient\SqlDependencyListener.cs (6)
983SqlNotificationType temp = (SqlNotificationType)Enum.Parse(typeof(SqlNotificationType), xmlReader.Value, true); 984if (Enum.IsDefined(typeof(SqlNotificationType), temp)) { 998SqlNotificationSource temp = (SqlNotificationSource)Enum.Parse(typeof(SqlNotificationSource), xmlReader.Value, true); 999if (Enum.IsDefined(typeof(SqlNotificationSource), temp)) { 1026SqlNotificationInfo temp = (SqlNotificationInfo)Enum.Parse(typeof(SqlNotificationInfo), value, true); 1027if (Enum.IsDefined(typeof(SqlNotificationInfo), temp)) {
fx\src\data\System\Data\SqlClient\TdsParser.cs (1)
1382string sqlContextInfo = Res.GetString(Enum.GetName(typeof(SniContext), stateObj.SniContext));
System.Data.Entity (40)
System\Data\Common\CommandTrees\ExpressionBuilder\Internal\ArgumentValidation.cs (3)
91Enum.GetName(typeof(PrimitiveTypeKind), valueTypeKind) 93Enum.GetName(typeof(PrimitiveTypeKind), requiredResultType) 2112Convert.ChangeType(Enum.Parse(clrEnumType, edmEnumTypeMember.Name), clrEnumType.GetEnumUnderlyingType(), CultureInfo.InvariantCulture)))
System\Data\Common\CommandTrees\Internal\ExpressionDumper.cs (3)
212"BuiltInTypeKind", Enum.GetName(typeof(BuiltInTypeKind), type.BuiltInTypeKind), 293"RelationshipMultiplicity", Enum.GetName(typeof(RelationshipMultiplicity), end.RelationshipMultiplicity) 359attrs.Add("DbExpressionKind", Enum.GetName(typeof(DbExpressionKind), expr.ExpressionKind));
System\Data\Common\CommandTrees\Internal\ExpressionKeyGen.cs (1)
62var names = Enum.GetNames(typeof(DbExpressionKind));
System\Data\Common\CommandTrees\Internal\ExpressionPrinter.cs (1)
273return new TreeNode(Enum.GetName(typeof(DbExpressionKind), expr.ExpressionKind));
System\Data\Common\CommandTrees\Internal\Validator.cs (1)
164ThrowInvalid(Strings.Cqt_Validator_InvalidIncorrectDataSpaceMetadata(typeof(TMetadata).Name, Enum.GetName(typeof(DataSpace), this.requiredSpace)));
System\Data\Common\CommandTrees\OperatorExpressions.cs (3)
134"Invalid DbExpressionKind used in DbArithmeticExpression: " + Enum.GetName(typeof(DbExpressionKind), kind) 284"Invalid DbExpressionKind used in DbComparisonExpression: " + Enum.GetName(typeof(DbExpressionKind), kind) 374Debug.Assert(DbExpressionKind.IsOf == this.ExpressionKind || DbExpressionKind.IsOfOnly == this.ExpressionKind, string.Format(CultureInfo.InvariantCulture, "Invalid DbExpressionKind used in DbIsOfExpression: {0}", Enum.GetName(typeof(DbExpressionKind), this.ExpressionKind)));
System\Data\Common\QueryCache\CompiledQueryCacheEntry.cs (1)
115return string.Join("", Enum.GetName(typeof(MergeOption), mergeOption), useCSharpNullComparisonBehavior);
System\Data\Common\QueryCache\EntityClientCacheKey.cs (1)
201return String.Join("|", new string[] { Enum.GetName(typeof(CommandType), _commandType), _eSqlStatement, _parametersToken });
System\Data\Common\QueryCache\EntitySqlQueryCacheKey.cs (1)
154return String.Join("|", new string[] { _defaultContainer, _eSqlStatement, _parametersToken, _includePathsToken, Enum.GetName(typeof(MergeOption), _mergeOption) });
System\Data\Common\QueryCache\LinqQueryCacheKey.cs (1)
144return String.Join("|", new string[] { _expressionKey, _parametersToken, _includePathsToken, Enum.GetName(typeof(MergeOption), _mergeOption), _useCSharpNullComparisonBehavior.ToString() });
System\Data\EntityModel\SchemaObjectModel\TypeElement.cs (1)
199_primitiveType.PrimitiveTypeKind = (PrimitiveTypeKind)Enum.Parse(typeof(PrimitiveTypeKind), value);
System\Data\Mapping\Update\Internal\UpdateTranslator.cs (1)
564value = Enum.ToObject(clrEnumType, value);
System\Data\Mapping\ViewGeneration\ConfigViewGenerator.cs (1)
58int numEnums = Enum.GetNames(typeof(PerfType)).Length;
System\Data\Metadata\Converter.cs (6)
32Debug.Assert(Enum.GetUnderlyingType(typeof(ConcurrencyMode)) == typeof(int), "Please update underlying type below accordingly."); 41foreach (string name in Enum.GetNames(typeof(ConcurrencyMode))) 46(int)Enum.Parse(typeof(ConcurrencyMode), name, false))); 49Debug.Assert(Enum.GetUnderlyingType(typeof(StoreGeneratedPattern)) == typeof(int), "Please update underlying type below accordingly."); 57foreach (string name in Enum.GetNames(typeof(StoreGeneratedPattern))) 62(int)Enum.Parse(typeof(StoreGeneratedPattern), name, false)));
System\Data\Metadata\Edm\EnumType.cs (2)
100foreach (string name in Enum.GetNames(clrType)) 105Convert.ChangeType(Enum.Parse(clrType, name), clrType.GetEnumUnderlyingType(), CultureInfo.InvariantCulture)));
System\Data\Metadata\Edm\MetadataItem_Static.cs (1)
282Enum.GetNames(typeof(PrimitiveTypeKind)));
System\Data\Metadata\ObjectLayer\ObjectItemConventionAssemblyLoader.cs (1)
304Enum.Parse(enumType, ospaceSortedEnumMemberNamesEnumerator.Current), enumUnderlyingType, CultureInfo.InvariantCulture)))
System\Data\Objects\ObjectContext.cs (1)
3334_objectParameter.Value = Enum.ToObject(_objectParameter.MappableType, _entityParameter.Value);
System\Data\Query\PlanCompiler\CTreeGenerator.cs (4)
634PlanCompiler.Assert(retExpr != null, string.Format(CultureInfo.InvariantCulture, "Unresolvable Var used in Command: VarType={0}, Id={1}", Enum.GetName(typeof(VarType), referencedVar.VarType), referencedVar.Id)); 789PlanCompiler.Assert(resultExpr != null, string.Format(CultureInfo.InvariantCulture, "ArithmeticOp OpType not recognized: {0}", Enum.GetName(typeof(OpType), op.OpType))); 897PlanCompiler.Assert(compExpr != null, string.Format(CultureInfo.InvariantCulture, "ComparisonOp OpType not recognized: {0}", Enum.GetName(typeof(OpType), op.OpType))); 956PlanCompiler.Assert(condExpr != null, string.Format(CultureInfo.InvariantCulture, "ConditionalOp OpType not recognized: {0}", Enum.GetName(typeof(OpType), op.OpType)));
System\Data\SqlClient\SqlGen\SqlGenerator.cs (6)
1092throw EntityUtil.NotSupported(System.Data.Entity.Strings.SqlGen_TypedNaNNotSupported(Enum.GetName(typeof(PrimitiveTypeKind), PrimitiveTypeKind.Double))); 1096throw EntityUtil.NotSupported(System.Data.Entity.Strings.SqlGen_TypedPositiveInfinityNotSupported(Enum.GetName(typeof(PrimitiveTypeKind), PrimitiveTypeKind.Double), typeof(Double).Name)); 1100throw EntityUtil.NotSupported(System.Data.Entity.Strings.SqlGen_TypedNegativeInfinityNotSupported(Enum.GetName(typeof(PrimitiveTypeKind), PrimitiveTypeKind.Double), typeof(Double).Name)); 1113throw EntityUtil.NotSupported(System.Data.Entity.Strings.SqlGen_TypedNaNNotSupported(Enum.GetName(typeof(PrimitiveTypeKind), PrimitiveTypeKind.Single))); 1117throw EntityUtil.NotSupported(System.Data.Entity.Strings.SqlGen_TypedPositiveInfinityNotSupported(Enum.GetName(typeof(PrimitiveTypeKind), PrimitiveTypeKind.Single), typeof(Single).Name)); 1121throw EntityUtil.NotSupported(System.Data.Entity.Strings.SqlGen_TypedNegativeInfinityNotSupported(Enum.GetName(typeof(PrimitiveTypeKind), PrimitiveTypeKind.Single), typeof(Single).Name));
System.Data.Entity.Design (1)
System\Data\EntityModel\Emitters\PropertyEmitter.cs (1)
506return new CodeFieldReferenceExpression(new CodeTypeReferenceExpression(TypeReference.ForType(type)), Enum.GetName(type, value));
System.Data.Linq (12)
DbConvert.cs (5)
95return Enum.Parse(toType, text); 98return Enum.ToObject(toType, Convert.ChangeType(value, Enum.GetUnderlyingType(toType), Globalization.CultureInfo.InvariantCulture)); 103return Enum.GetName(fromType, value); 107Enum.GetUnderlyingType(fromType),
Mapping\MappingSource.cs (2)
599cm.UpdateCheck = (updateCheck == null) ? UpdateCheck.Always : (UpdateCheck)Enum.Parse(typeof(UpdateCheck), updateCheck); 601cm.AutoSync = (autoSync == null) ? AutoSync.Default : (AutoSync)Enum.Parse(typeof(AutoSync), autoSync);
parent\DbmlShared\Mapping.cs (3)
226: (MappingParameterDirection)Enum.Parse(typeof(MappingParameterDirection), value, true); 401set { this.updateCheck = (value == null) ? UpdateCheck.Always : (UpdateCheck)Enum.Parse(typeof(UpdateCheck), value); } 411set { this.autoSync = (value != null) ? (AutoSync)Enum.Parse(typeof(AutoSync), value) : AutoSync.Default; }
SqlClient\SqlTypeSystemProvider.cs (2)
877if (!Enum.GetNames(typeof(SqlDbType)).Select(n => n.ToUpperInvariant()).Contains(typeName.ToUpperInvariant())) 884SqlDbType dbType = (SqlDbType)Enum.Parse(typeof(SqlDbType), typeName, true);
System.Data.Services (3)
System\Data\Services\DataServiceConfiguration.cs (1)
849Enum.GetValues(typeof(DataServiceProtocolVersion)).Length == 2,
System\Data\Services\Epm\EpmHelper.cs (1)
246Debug.Assert(Enum.GetNames(typeof(SyndicationItemProperty)).Count() == 12, "Any addition to SyndicationItemPropery enum requires updating this method.");
System\Data\Services\WebUtil.cs (1)
294Debug.Assert(Enum.IsDefined(typeof(T), value), "enum value is not valid");
System.Data.Services.Design (3)
parent\Server\System\Data\Services\Epm\EpmHelper.cs (1)
246Debug.Assert(Enum.GetNames(typeof(SyndicationItemProperty)).Count() == 12, "Any addition to SyndicationItemPropery enum requires updating this method.");
System\Data\EntityModel\Emitters\EntityContainerEmitter.cs (1)
252Enum.GetName(typeof(StringComparison), this.Generator.LanguageAppropriateStringComparer));
System\Data\EntityModel\Emitters\PropertyEmitter.cs (1)
466return new CodeFieldReferenceExpression(new CodeTypeReferenceExpression(TypeReference.ForType(type)), Enum.GetName(type, value));
System.Data.SqlXml (8)
System\Xml\Xsl\IlGen\OptimizerPatterns.cs (3)
57private static readonly int PatternCount = Enum.GetValues(typeof(OptimizerPatternName)).Length; 222Debug.Assert(Enum.IsDefined(typeof(OptimizerPatternName), pattern)); 232Debug.Assert(Enum.IsDefined(typeof(OptimizerPatternName), pattern));
System\Xml\Xsl\QIL\QilXmlReader.cs (2)
282Debug.Assert(r.LocalName == Enum.GetName(typeof(QilNodeType), nd.NodeType), "Id '" + id + "' is not not bound to a " + r.LocalName + " forward decl"); 431types[i] = XmlQueryTypeFactory.Type((XmlTypeCode)Enum.Parse(typeof(XmlTypeCode), codes[i]), strict);
System\Xml\Xsl\QIL\QilXmlWriter.cs (2)
198this.writer.WriteStartElement(Enum.GetName(typeof(QilNodeType), n.NodeType)); 263this.writer.WriteStartElement("", Enum.GetName(typeof(QilNodeType), node.NodeType), "");
System\Xml\Xsl\Runtime\XmlExtensionFunction.cs (1)
294return Enum.GetUnderlyingType(clrType);
System.Drawing (9)
commonui\System\Drawing\FontConverter.cs (1)
160style |= (FontStyle)Enum.Parse(typeof(FontStyle), styleText, true);
commonui\System\Drawing\Printing\PrinterSettings.cs (1)
452if (!Enum.IsDefined(typeof(PrintRange), value))
commonui\System\Drawing\Printing\PrintingPermission.cs (2)
176securityElement.AddAttribute("Level", Enum.GetName(typeof(PrintingPermissionLevel), printingLevel)); 215printingLevel = (PrintingPermissionLevel)Enum.Parse(typeof(PrintingPermissionLevel), printing);
misc\ClientUtils.cs (5)
68public static bool IsEnumValid(Enum enumValue, int value, int minValue, int maxValue) 85public static bool IsEnumValid(Enum enumValue, int value, int minValue, int maxValue, int maxNumberOfBitsOn) { 105public static bool IsEnumValid_Masked(Enum enumValue, int value, UInt32 mask) { 133public static bool IsEnumValid_NotSequential(System.Enum enumValue, int value, params int[] enumValues) { 134System.Diagnostics.Debug.Assert(Enum.GetValues(enumValue.GetType()).Length == enumValues.Length, "Not all the enum members were passed in.");
System.IdentityModel (2)
System\IdentityModel\Configuration\StandardRuntimeEnumValidator.cs (1)
27if (!Enum.IsDefined(enumType, value))
System\IdentityModel\Tokens\X509CertificateStoreTokenResolver.cs (1)
37: this(Enum.GetName(typeof(System.Security.Cryptography.X509Certificates.StoreName), storeName), storeLocation)
System.Management (1)
WmiGenerator.cs (1)
4129cboe1.Right = new CodeTypeOfExpression(typeof(System.Enum));
System.Messaging (5)
System\Messaging\MessageQueueInstaller.cs (1)
314if (!Enum.IsDefined(typeof(UninstallAction), value))
System\Messaging\MessageQueuePermission.cs (4)
177if (Enum.IsDefined(typeof(MessageQueuePermissionAccess), currentAccess)) 178permissionAccess = permissionAccess | (int)Enum.Parse(typeof(MessageQueuePermissionAccess), currentAccess); 433int[] enumValues = (int[])Enum.GetValues(typeof(MessageQueuePermissionAccess)); 444accessStringBuilder.Append(Enum.GetName(typeof(MessageQueuePermissionAccess), enumValues[index]));
System.Runtime.Remoting (29)
channels\ipc\ipcclientchannel.cs (1)
412Enum.Parse(typeof(TokenImpersonationLevel),
channels\sinks\binaryformattersinks.cs (1)
336_formatterSecurityLevel = (TypeFilterLevel) Enum.Parse(typeof(TypeFilterLevel), (string)entry.Value);
channels\sinks\soapformattersinks.cs (1)
388_formatterSecurityLevel = (TypeFilterLevel) Enum.Parse(typeof(TypeFilterLevel), (string)entry.Value);
channels\tcp\tcpclientchannel.cs (3)
611Enum.Parse(typeof(SocketCachePolicy), 619Enum.Parse(typeof(TokenImpersonationLevel), 625Enum.Parse(typeof(ProtectionLevel),
channels\tcp\tcpserverchannel.cs (1)
110Enum.Parse(typeof(ProtectionLevel),
metadata\wsdlparser.cs (18)
1341Util.Log("WsdlParser.ProcessSudsUse use exit "+((Enum)sudsUse).ToString()); 2606Util.Log("WsdlParser.MatchingSchemaStrings left "+left+" _xsdVersion "+((Enum)_xsdVersion).ToString()); 2742Util.Log("WsdlParser.PrintCSC Interop "+urtNS.EncodedNS+" "+urtNS.Namespace+" urtType "+((Enum)urtNS.UrtType).ToString()); 2751Util.Log("WsdlParser.PrintCSC fileName urtNS "+urtNS.Namespace+" urtType "+((Enum)urtNS.UrtType).ToString()); 2811Util.Log("WsdlParser.IsURTExportedType Exit "+((Enum)urtType).ToString()); 3463Util.Log("URTMethod.URTMethod methodFlags "+((Enum)_methodFlags).ToString()); 3583Util.Log("URTMethod.ResolveMethodAttributes "+Name+" MethodFlags "+((Enum)_methodFlags).ToString()); 3687Util.Log("URTMethod.FindMethodAttributes Exit "+Name+" "+((Enum)_methodFlags).ToString()); 3737Util.Log("URTMethod.PrintCSC name "+_methodName+" namePrefix "+namePrefix+" curNS "+curNS+" MethodPrintEnum "+((Enum)methodPrintEnum).ToString()); 4104Util.Log("URTMethod.ResolveWsdlParams actualType 2 UrtType "+((Enum)ns.UrtType).ToString()); 4214Util.Log("RRMethod.PrintCSC name "+_requestElementName+" namePrefix "+namePrefix+" curNS "+curNS+" methodPrintEnum "+((Enum)methodPrintEnum).ToString()); 4335Util.Log("OnewayMethod.PrintCSC name "+_messageElementName+" namePrefix "+namePrefix+" curNS "+curNS+" methodPrintEnum "+((Enum)methodPrintEnum).ToString()); 4719Util.Log("URTInterface.NewNeeded Exit interface "+Name+" method "+method.Name+" "+((Enum)method.MethodFlags).ToString()); 4750Util.Log("URTInterface.ResolveTypes Is System "+Name+" iType "+((Enum)iType).ToString()+" baseIFaceNS "+baseIFaceNS); 5894Util.Log("URTComplexType.PrintCSC enter name "+Name+" curNS "+curNS+" sudsUse "+((Enum)_sudsUse).ToString()+" bNestedType "+bNestedType+" bNestedTypePrint "+bNestedTypePrint); 6067Util.Log("URTComplexType.PrintCSC _sudsType "+((Enum)_sudsType).ToString()); 7380Util.Log("WsdlBindingSuds.UsedNamespace elementName "+elementName+" typeName "+typeName+" ns "+ns+" extendsTypeName "+extendsTypeName+" extendsNs "+extendsNs+" sudsUse "+((Enum)sudsUse).ToString()); 7399Util.Log(" sudsUse "+((Enum)sudsUse).ToString());
metadata\wsdlwriter.cs (4)
193Util.Log("WsdlGenerator.ProcessTypeAttributes "+type+" SoapOptions "+((Enum)att.SoapOptions).ToString()+" _xsdVersion "+((Enum)_xsdVersion).ToString()); 1147String baseName = RealSchemaType.TypeName(Enum.GetUnderlyingType(type), true, xns); 1149String[] values = Enum.GetNames(type);
System.Runtime.Serialization (12)
System\Runtime\Serialization\CodeGenerator.cs (3)
1054Ldc(((IConvertible)o).ToType(Enum.GetUnderlyingType(valueType), null)); 1409Ldelem(Enum.GetUnderlyingType(arrayElementType)); 1473Stelem(Enum.GetUnderlyingType(arrayElementType));
System\Runtime\Serialization\DataContract.cs (2)
778type = typeof(Enum); 865else if (type == typeof(Enum) || type == typeof(ValueType))
System\Runtime\Serialization\EnumDataContract.cs (3)
192Type baseType = Enum.GetUnderlyingType(type); 423return Enum.ToObject(UnderlyingType, (ulong)longValue); 424return Enum.ToObject(UnderlyingType, longValue);
System\Runtime\Serialization\Json\JsonEnumDataContract.cs (2)
39enumValue = Enum.ToObject(TraditionalDataContract.UnderlyingType, jsonReader.ReadElementContentAsUnsignedLong()); 43enumValue = Enum.ToObject(TraditionalDataContract.UnderlyingType, jsonReader.ReadElementContentAsLong());
System\Runtime\Serialization\Json\JsonFormatGeneratorStatics.cs (1)
547parseEnumMethod = typeof(Enum).GetMethod("Parse", BindingFlags.Static | BindingFlags.Public, null, new Type[] { typeof(Type), typeof(string) }, null);
System\Runtime\Serialization\Json\XmlObjectSerializerWriteContextComplexJson.cs (1)
142if (declaredContract.UnderlyingType == typeof(Enum))
System.Security (1)
system\security\permissions\dataprotectionpermission.cs (1)
142DataProtectionPermissionFlags flags = (DataProtectionPermissionFlags) Enum.Parse(typeof(DataProtectionPermissionFlags), strFlags);
System.ServiceModel (31)
System\ServiceModel\Administration\AppDomainInstanceProvider.cs (1)
143SourceLevels newLevel = (SourceLevels)Enum.Parse(typeof(SourceLevels), (string)instance.GetProperty(AdministrationStrings.TraceLevel));
System\ServiceModel\Channels\AuthenticationSchemesHelper.cs (1)
32if (!Enum.TryParse<AuthenticationSchemes>(authType, true, out authTypeScheme))
System\ServiceModel\Channels\HttpHeaderInfo.cs (2)
49AddKnownHeaders(Enum.GetNames(httpRequestHeaderType).Select(enumString => GetHeaderString(enumString)), true); 50AddKnownHeaders(Enum.GetNames(httpResponseHeaderType).Select(enumString => GetHeaderString(enumString)), false);
System\ServiceModel\Channels\HttpTransportBindingElement.cs (1)
854if (!Enum.TryParse<TransferMode>(transferMode, true, out result) || !TransferModeHelper.IsDefined(result) || result == TransferMode.Buffered)
System\ServiceModel\Channels\SecurityAttributeGenerationHelper.cs (1)
42else if (value is Enum)
System\ServiceModel\Channels\WindowsStreamSecurityBindingElement.cs (1)
156windowsBindingElement.ProtectionLevel = (ProtectionLevel)Enum.Parse(typeof(ProtectionLevel), protectionLevelString);
System\ServiceModel\ComIntegration\ChannelCredentials.cs (11)
108StoreLocation location = (StoreLocation)Enum.Parse(typeof(StoreLocation), storeLocation); 109X509RevocationMode mode = (X509RevocationMode)Enum.Parse(typeof(X509RevocationMode), revocationMode); 113validationMode = (X509CertificateValidationMode)Enum.Parse(typeof(X509CertificateValidationMode), certificationValidationMode); 132StoreLocation location = (StoreLocation)Enum.Parse(typeof(StoreLocation), storeLocation); 133StoreName name = (StoreName)Enum.Parse(typeof(StoreName), storeName); 134X509FindType type = (X509FindType)Enum.Parse(typeof(X509FindType), findType); 161X509KeyStorageFlags flags = (X509KeyStorageFlags)Enum.Parse(typeof(X509KeyStorageFlags), keyStorageFlags); 182StoreLocation location = (StoreLocation)Enum.Parse(typeof(StoreLocation), storeLocation); 183StoreName name = (StoreName)Enum.Parse(typeof(StoreName), storeName); 184X509FindType type = (X509FindType)Enum.Parse(typeof(X509FindType), findType); 210X509KeyStorageFlags flags = (X509KeyStorageFlags)Enum.Parse(typeof(X509KeyStorageFlags), keyStorageFlags);
System\ServiceModel\Configuration\StandardRuntimeEnumValidator.cs (1)
27if (!Enum.IsDefined(enumType, value))
System\ServiceModel\Configuration\StandardRuntimeFlagEnumValidator.cs (3)
25if (!Enum.IsDefined(typeof(TEnum), value)) 28if (!Enum.TryParse<TEnum>(value.ToString(), true, out dummy)) 34int[] values = (int[])Enum.GetValues(typeof(TEnum));
System\ServiceModel\Configuration\StandardRuntimeFlagEnumValidatorAttribute.cs (1)
51int[] values = (int[])Enum.GetValues(value);
System\ServiceModel\Description\OperationGenerator.cs (1)
1035return new CodeFieldReferenceExpression(new CodeTypeReferenceExpression(type), Enum.Format(type, val, "G"));
System\ServiceModel\Description\PrincipalPermissionMode.cs (1)
22return Enum.IsDefined( typeof( PrincipalPermissionMode ), principalPermissionMode );
System\ServiceModel\Description\ServiceContractGenerator.cs (1)
235return new CodeFieldReferenceExpression(new CodeTypeReferenceExpression(typeof(EnumType)), Enum.Format(typeof(EnumType), value, "G"));
System\ServiceModel\Dispatcher\CodeGenerator.cs (3)
434Ldc(((IConvertible)o).ToType(Enum.GetUnderlyingType(valueType), null)); 712Ldelem(Enum.GetUnderlyingType(arrayElementType)); 739Stelem(Enum.GetUnderlyingType(arrayElementType));
System\ServiceModel\Security\SecurityUtils.cs (1)
114foreach (var protocol in Enum.GetValues(typeof(SslProtocols)))
System\ServiceModel\Security\WSTrustChannel.cs (1)
69throw IM.DiagnosticUtility.ThrowHelperInvalidOperation(SR.GetString(SR.ID3285, Enum.GetName(typeof(Operations), _operation)));
System.ServiceModel.Internals (2)
System\Runtime\TypeHelper.cs (2)
283if (sourceType.IsEnum && destinationType == typeof(Enum)) 567Array enumValues = Enum.GetValues(type);
System.ServiceModel.Web (5)
System\ServiceModel\Dispatcher\QueryStringConverter.cs (5)
61if (typeof(Enum).IsAssignableFrom(type)) 85if (typeof(Enum).IsAssignableFrom(parameterType)) 87return Enum.Parse(parameterType, parameter, true); 184if (typeof(Enum).IsAssignableFrom(parameterType)) 186return Enum.Format(parameterType, parameter, "G");
System.Web (22)
Compilation\AssemblyBuilder.cs (2)
591string fieldName = Enum.GetName(enumType, set); 598string fieldName = Enum.GetName(enumType, set);
Configuration\SessionStateSection.cs (3)
467if (Enum.IsDefined(enumType, s)) { 468iTemp = (int)Enum.Parse(enumType, s); 473foreach (string name in Enum.GetNames(enumType)) {
HttpCookie.cs (1)
430if(Enum.TryParse<SameSiteMode>(attributeValue, true, out sameSite)) {
ModelBinding\ValueProviderResult.cs (1)
64return Enum.ToObject(destinationType, (int)value);
Security\ADMembershipProvider.cs (1)
596_LegacyPasswordCompatibilityMode = (MembershipPasswordCompatibilityMode) Enum.Parse(typeof(MembershipPasswordCompatibilityMode), temp);
Security\SQLMembershipProvider.cs (1)
191_LegacyPasswordCompatibilityMode = (MembershipPasswordCompatibilityMode)Enum.Parse(typeof(MembershipPasswordCompatibilityMode), temp);
UI\ControlBuilder.cs (1)
1052entry.PersistedValue = Enum.Format(memberType, objectValue, "G");
UI\ObjectStateFormatter.cs (2)
601return Enum.ToObject(enumType, enumValue); 1122Type underlyingType = Enum.GetUnderlyingType(valueType);
UI\PageParser.cs (1)
241_mainDirectiveConfigSettings["viewStateEncryptionMode"] = Enum.Format(typeof(ViewStateEncryptionMode), PagesConfig.ViewStateEncryptionMode, "G");
UI\PropertyConverter.cs (2)
35return Enum.Parse(enumType, value, true); 50string value = Enum.Format(enumType, enumValue, "G");
UI\Util.cs (2)
968val = Enum.Parse(enumType, value, true /*ignoreCase*/); 972foreach (string n in Enum.GetNames(enumType)) {
UI\WebControls\TextBox.cs (1)
596string result = Enum.Format(typeof(AutoCompleteType), type, "G");
UI\WebControls\WebControl.cs (1)
530tagName = Enum.Format(typeof(HtmlTextWriterTag), TagKey, "G").ToLower(CultureInfo.InvariantCulture);
UI\WebParts\PropertyGridEditorPart.cs (2)
197else if (typeof(Enum).IsAssignableFrom(propertyType)) { 342else if (typeof(Enum).IsAssignableFrom(propertyType)) {
Util\SecUtil.cs (1)
222if (sValue == null || !Enum.TryParse(sValue, out unit)) {
System.Web.DataVisualization (22)
Common\Annotation\AnnotationBase.cs (1)
3316switch ((AxisName)Enum.Parse(typeof(AxisName), axisType))
Common\ChartTypes\BoxPlotChart.cs (1)
793 MarkerStyle marker = (MarkerStyle)Enum.Parse(typeof(MarkerStyle), markerStyle, true);
Common\ChartTypes\ErrorBarChart.cs (1)
854 MarkerStyle marker = (MarkerStyle)Enum.Parse(typeof(MarkerStyle), markerStyle, true);
Common\ChartTypes\FunnelChart.cs (6)
2119 labelStyle = (FunnelLabelStyle)Enum.Parse(typeof(FunnelLabelStyle), attrValue, true); 2496 drawingStyle = (FunnelStyle)Enum.Parse(typeof(FunnelStyle), attrValue, true); 2523 placement = (FunnelLabelPlacement)Enum.Parse(typeof(FunnelLabelPlacement), attrValue, true); 2549 alignment = (FunnelLabelVerticalAlignment)Enum.Parse(typeof(FunnelLabelVerticalAlignment), attrValue, true); 2576 drawingStyle = (Funnel3DDrawingStyle)Enum.Parse(typeof(Funnel3DDrawingStyle), attrValue, true); 2725 valueType = (PyramidValueType)Enum.Parse(typeof(PyramidValueType), attrValue, true);
Common\Converters\CustomAttributesConverters.cs (2)
468foreach (ChartTypes.ErrorBarType item in Enum.GetValues(typeof(ChartTypes.ErrorBarType))) 673 result = Enum.Parse(this._customAttributeInfo.ValueType, stringValue, true);
Common\DataManager\DataPoint.cs (3)
2912 DeleteCustomProperty((CommonCustomProperties)Enum.Parse(typeof(CommonCustomProperties), commonName)); 3204return Enum.GetName(typeof(CommonCustomProperties), key); 4727 Array enumValues = Enum.GetValues(typeof(CommonCustomProperties));
Common\DataManager\DataSeries.cs (2)
846 return Enum.GetName(typeof(SeriesChartType), type); 2391type = (SeriesChartType)Enum.Parse(typeof(SeriesChartType), this.ChartTypeName, true);
Common\Formulas\FormulaHelpers.cs (2)
1523seriesField = (DataField)Enum.Parse(typeof(DataField), seriesFieldId, true); 1616seriesField = (DataField)Enum.Parse(typeof(DataField), seriesFieldId, true);
Common\General\ChartGraphics.cs (1)
362 hatch = (HatchStyle)Enum.Parse(typeof(HatchStyle),hatchStyle.ToString());
Common\General\ChartSerializer.cs (1)
658 Array enumValues = Enum.GetValues(typeof(SerializationContents ));
Common\Utilities\XmlSerializer.cs (1)
3101 objValue = Enum.Parse(pi.PropertyType, reader.ReadString());
WebForm\General\ChartHttpHandler.cs (1)
1147ImageOwnerKey = (ImageOwnerKeyType)Enum.Parse(typeof(ImageOwnerKeyType), value, true);
System.Web.DynamicData (3)
DynamicData\Util\Misc.cs (3)
146var enumEntries = from e in Enum.GetValues(enumType).OfType<object>() 149Name = Enum.GetName(enumType, e), 164return Convert.ChangeType(enumValue, Enum.GetUnderlyingType(enumType), CultureInfo.InvariantCulture);
System.Web.Entity (1)
System\Data\WebControls\EntityDataSourceUtil.cs (1)
572value = Enum.ToObject(underlyingType ?? type, value);
System.Web.Extensions (8)
Script\Serialization\JavaScriptSerializer.cs (2)
482Type underlyingType = Enum.GetUnderlyingType(type); 492sb.Append(((Enum)o).ToString("D"));
Script\Services\WebServiceData.cs (3)
381enumData = new WebServiceEnumData(t.Name, t.Namespace, t, Enum.GetNames(t), Enum.GetValues(t), Enum.GetUnderlyingType(t) == typeof(ulong));
Script\Services\WebServiceTypeData.cs (3)
244bool isUlong = (Enum.GetUnderlyingType(type) == typeof(ulong)); 245typeData = new WebServiceEnumData(XmlConvert.DecodeName(qname.Name), XmlConvert.DecodeName(qname.Namespace), Enum.GetNames(type), Enum.GetValues(type), isUlong);
System.Web.Mobile (18)
UI\MobileControls\Adapters\HtmlMobileTextWriter.cs (1)
1269Enum.GetName(typeof(Alignment), newStyle.Alignment));
UI\MobileControls\Design\Adapters\DesignerAdRotatorAdapter.cs (1)
62writer.WriteAttribute("align", Enum.GetName(typeof(Alignment), alignment));
UI\MobileControls\Design\Adapters\DesignerCalendarAdapter.cs (1)
41writer.WriteAttribute("align", Enum.GetName(typeof(Alignment), alignment));
UI\MobileControls\Design\Adapters\DesignerCommandAdapter.cs (3)
124writer.WriteAttribute("align", Enum.GetName(typeof(Alignment), alignment)); 167writer.WriteAttribute("align", Enum.GetName(typeof(Alignment), alignment)); 203writer.WriteAttribute("align", Enum.GetName(typeof(Alignment), alignment));
UI\MobileControls\Design\Adapters\DesignerImageAdapter.cs (1)
72writer.WriteAttribute("align", Enum.GetName(typeof(Alignment), alignment));
UI\MobileControls\Design\Adapters\DesignerLabelAdapter.cs (1)
60writer.WriteAttribute("align", Enum.GetName(typeof(Alignment), alignment));
UI\MobileControls\Design\Adapters\DesignerLinkAdapter.cs (1)
57writer.WriteAttribute("align", Enum.GetName(typeof(Alignment), alignment));
UI\MobileControls\Design\Adapters\DesignerTextBoxAdapter.cs (1)
147writer.Write(";text-align:" + Enum.GetName(typeof(Alignment), alignment));
UI\MobileControls\Design\Adapters\DesignerTextViewAdapter.cs (1)
64writer.WriteAttribute("align", Enum.GetName(typeof(Alignment), alignment));
UI\MobileControls\Design\Adapters\DesignerTextWriter.cs (1)
93Write(";text-align:" + Enum.GetName(typeof(Alignment), alignment));
UI\MobileControls\Design\Adapters\DesignerValidationSummaryAdapter.cs (1)
61writer.WriteAttribute("align", Enum.GetName(typeof(Alignment), alignment));
UI\MobileControls\Design\Adapters\DesignerValidatorAdapter.cs (1)
59writer.WriteAttribute("align", Enum.GetName(typeof(Alignment), alignment));
UI\MobileControls\Design\MobileContainerDesigner.cs (1)
211alignmentNotSet ? "" : Enum.Format(typeof(Alignment), alignment, "G"));
UI\MobileControls\Design\MobileControlPersister.cs (1)
571persistValue = Enum.Format(propType, obj, "G");
UI\MobileControls\DeviceSpecificChoice.cs (1)
237o = Enum.Parse(type, value, true);
UI\MobileControls\FontInfo.cs (1)
128String size = (this.Size.Equals(FontSize.NotSet) ? null : Enum.GetName(typeof(FontSize), this.Size));
System.Web.Services (9)
System\Web\Services\Configuration\ProtocolElement.cs (1)
47return Enum.IsDefined(typeof(WebServiceProtocols), value);
System\Web\Services\Configuration\SoapExtensionTypeElement.cs (1)
43if (Enum.IsDefined(typeof(PriorityGroup), value))
System\Web\Services\Configuration\WsiProfilesElement.cs (1)
47return Enum.IsDefined(typeof(WsiProfiles), value);
System\Web\Services\Description\SoapHttpTransportImporter.cs (1)
28CodeFieldReferenceExpression versionEnumFieldReference = new CodeFieldReferenceExpression(versionEnumTypeReference, Enum.Format(typeof(SoapProtocolVersion), SoapProtocolVersion.Soap12, "G"));
System\Web\Services\Description\SoapProtocolImporter.cs (3)
767AddMetadataProperty("Use", new CodeFieldReferenceExpression(new CodeTypeReferenceExpression(typeof(SoapBindingUse).FullName), Enum.Format(typeof(SoapBindingUse), soapRequestBinding.Use, "G"))); 772AddMetadataProperty("Use", new CodeFieldReferenceExpression(new CodeTypeReferenceExpression(typeof(SoapBindingUse).FullName), Enum.Format(typeof(SoapBindingUse), soapRequestBinding.Use, "G"))); 773AddMetadataProperty("ParameterStyle", new CodeFieldReferenceExpression(new CodeTypeReferenceExpression(typeof(SoapParameterStyle).FullName), Enum.Format(typeof(SoapParameterStyle), hasWrapper ? SoapParameterStyle.Wrapped : SoapParameterStyle.Bare, "G")));
System\Web\Services\Protocols\Scalars.cs (2)
49return Enum.Parse(type, value); 53return Enum.Format(value.GetType(), value, "G");
System.Windows.Forms (33)
misc\ClientUtils.cs (5)
68public static bool IsEnumValid(Enum enumValue, int value, int minValue, int maxValue) 85public static bool IsEnumValid(Enum enumValue, int value, int minValue, int maxValue, int maxNumberOfBitsOn) { 105public static bool IsEnumValid_Masked(Enum enumValue, int value, UInt32 mask) { 133public static bool IsEnumValid_NotSequential(System.Enum enumValue, int value, params int[] enumValues) { 134System.Diagnostics.Debug.Assert(Enum.GetValues(enumValue.GetType()).Length == enumValues.Length, "Not all the enum members were passed in.");
misc\GDI\WindowsGraphics2.cs (2)
57Debug.Assert( Enum.IsDefined(typeof(TextPaddingOptions), this.paddingFlags)); 64Debug.Assert( Enum.IsDefined(typeof(TextPaddingOptions), value));
winforms\Managed\System\WinForms\AxHost.cs (1)
7149baseProp.SetValue(component, Enum.ToObject(this.PropertyType, value));
winforms\Managed\System\WinForms\ComponentModel\COM2Interop\COM2EnumConverter.cs (1)
81return Enum.ToObject(destinationType, value);
winforms\Managed\System\WinForms\ComponentModel\COM2Interop\COM2IPerPropertyBrowsingHandler.cs (1)
295valueItems[i] = Enum.ToObject(targetType, valueItems[i]);
winforms\Managed\System\WinForms\ComponentModel\COM2Interop\COM2PropertyDescriptor.cs (1)
933lastValue = Enum.ToObject(propertyType, lastValue);
winforms\Managed\System\WinForms\DataGridViewCellStyle.cs (1)
132Debug.Assert(Enum.IsDefined(typeof(DataGridViewContentAlignment), value));
winforms\Managed\System\WinForms\DataGridViewHeaderCell.cs (1)
62Debug.Assert(Enum.IsDefined(typeof(ButtonState), value));
winforms\Managed\System\WinForms\FolderBrowserDialog.cs (1)
169if (!Enum.IsDefined(typeof(System.Environment.SpecialFolder), value))
winforms\Managed\System\WinForms\KeyEvent.cs (1)
118if (!Enum.IsDefined(typeof(Keys),(int)keyGenerated))
winforms\Managed\System\WinForms\KeysConverter.cs (13)
119if (sourceType == typeof(string) || sourceType == typeof(Enum[])) { 131if (destinationType == typeof(Enum[])) { 181obj = Enum.Parse(typeof(Keys), tokens[i]); 216else if (value is Enum[]) { 218foreach(Enum e in (Enum[])value) { 221return Enum.ToObject(typeof(Keys), finalValue); 245if (!asString) asEnum = destinationType == typeof(Enum[]); 306if (!foundKey && Enum.IsDefined(typeof(Keys), (int)keyOnly)) { 308terms.Add(((Enum)keyOnly).ToString()); 311terms.Add((Enum)keyOnly); 323return (Enum[])terms.ToArray(typeof(Enum));
winforms\Managed\System\WinForms\MenuItem.cs (1)
635if (!Enum.IsDefined(typeof(Shortcut), value)) {
winforms\Managed\System\WinForms\PreviewKeyDownEventArgs.cs (1)
75if (!Enum.IsDefined(typeof(Keys),(int)keyGenerated))
winforms\Managed\System\WinForms\TableLayoutSettingsTypeConverter.cs (1)
204SizeType type = (SizeType)Enum.Parse(sizeTypeType, styleString.Substring(currentIndex, nextIndex - currentIndex), true);
winforms\Managed\System\WinForms\WebBrowser.cs (1)
1846&& Enum.IsDefined(typeof(Shortcut), (Shortcut)keyCode)) {
winforms\Managed\System\WinForms\WinFormsUtils.cs (1)
413public static bool IsEnumWithinShiftedRange(Enum enumValue, int numBitsToShift, int minValAfterShift, int maxValAfterShift){
System.Windows.Forms.DataVisualization (21)
Common\Annotation\AnnotationBase.cs (1)
3316switch ((AxisName)Enum.Parse(typeof(AxisName), axisType))
Common\ChartTypes\BoxPlotChart.cs (1)
793 MarkerStyle marker = (MarkerStyle)Enum.Parse(typeof(MarkerStyle), markerStyle, true);
Common\ChartTypes\ErrorBarChart.cs (1)
854 MarkerStyle marker = (MarkerStyle)Enum.Parse(typeof(MarkerStyle), markerStyle, true);
Common\ChartTypes\FunnelChart.cs (6)
2119 labelStyle = (FunnelLabelStyle)Enum.Parse(typeof(FunnelLabelStyle), attrValue, true); 2496 drawingStyle = (FunnelStyle)Enum.Parse(typeof(FunnelStyle), attrValue, true); 2523 placement = (FunnelLabelPlacement)Enum.Parse(typeof(FunnelLabelPlacement), attrValue, true); 2549 alignment = (FunnelLabelVerticalAlignment)Enum.Parse(typeof(FunnelLabelVerticalAlignment), attrValue, true); 2576 drawingStyle = (Funnel3DDrawingStyle)Enum.Parse(typeof(Funnel3DDrawingStyle), attrValue, true); 2725 valueType = (PyramidValueType)Enum.Parse(typeof(PyramidValueType), attrValue, true);
Common\Converters\CustomAttributesConverters.cs (2)
468foreach (ChartTypes.ErrorBarType item in Enum.GetValues(typeof(ChartTypes.ErrorBarType))) 673 result = Enum.Parse(this._customAttributeInfo.ValueType, stringValue, true);
Common\DataManager\DataPoint.cs (3)
2912 DeleteCustomProperty((CommonCustomProperties)Enum.Parse(typeof(CommonCustomProperties), commonName)); 3204return Enum.GetName(typeof(CommonCustomProperties), key); 4727 Array enumValues = Enum.GetValues(typeof(CommonCustomProperties));
Common\DataManager\DataSeries.cs (2)
846 return Enum.GetName(typeof(SeriesChartType), type); 2391type = (SeriesChartType)Enum.Parse(typeof(SeriesChartType), this.ChartTypeName, true);
Common\Formulas\FormulaHelpers.cs (2)
1523seriesField = (DataField)Enum.Parse(typeof(DataField), seriesFieldId, true); 1616seriesField = (DataField)Enum.Parse(typeof(DataField), seriesFieldId, true);
Common\General\ChartGraphics.cs (1)
362 hatch = (HatchStyle)Enum.Parse(typeof(HatchStyle),hatchStyle.ToString());
Common\General\ChartSerializer.cs (1)
658 Array enumValues = Enum.GetValues(typeof(SerializationContents ));
Common\Utilities\XmlSerializer.cs (1)
3101 objValue = Enum.Parse(pi.PropertyType, reader.ReadString());
System.Workflow.Activities (13)
Conditional.cs (1)
173return new ValidationError(SR.GetString(SR.Error_DynamicActivity, activity.QualifiedName, Enum.GetName(typeof(ActivityExecutionStatus), activity.ExecutionStatus)), ErrorNumbers.Error_DynamicActivity);
Designers\StateDesignerConnector.cs (2)
311DesignerEdges sourceEdge = (DesignerEdges)Enum.Parse(typeof(DesignerEdges), constructionArguments["SourceConnectionEdge"] as string); 322DesignerEdges targetEdge = (DesignerEdges)Enum.Parse(typeof(DesignerEdges), constructionArguments["TargetConnectionEdge"] as string);
EventHandlingScope.cs (2)
250return new ValidationError(SR.GetString(SR.Error_DynamicActivity2, activity.QualifiedName, Enum.GetName(typeof(ActivityExecutionStatus), activity.ExecutionStatus), activity.GetType().FullName), ErrorNumbers.Error_DynamicActivity2); 254return new ValidationError(SR.GetString(SR.Error_DynamicActivity3, activity.QualifiedName, Enum.GetName(typeof(ActivityExecutionStatus), activity.ExecutionStatus), activity.GetType().FullName), ErrorNumbers.Error_DynamicActivity2);
Rules\Executor.cs (3)
835currentType = Enum.GetUnderlyingType(currentType); 848Type underlyingType = Enum.GetUnderlyingType(resultType); 852converted = Enum.ToObject(resultType, adjusted);
Rules\Helpers.cs (1)
274underlyingType = Enum.GetUnderlyingType(type);
Rules\RuleValidation.cs (3)
692lhsRootType = Enum.GetUnderlyingType(lhsBaseType); 694rhsRootType = Enum.GetUnderlyingType(rhsBaseType); 755get { return typeof(Enum); }
While.cs (1)
187return new ValidationError(SR.GetString(SR.Error_DynamicActivity2, activity.QualifiedName, Enum.GetName(typeof(ActivityExecutionStatus), activity.ExecutionStatus), activity.GetType().FullName), ErrorNumbers.Error_DynamicActivity2);
System.Workflow.ComponentModel (12)
AuthoringOM\Compiler\TypeSystem\AttributeInfo.cs (1)
194return Enum.Parse(requestedType, parseableValue);
AuthoringOM\Compiler\TypeSystem\DesignTimeType.cs (2)
225Type enumBaseType = declaration.UserData[typeof(Enum)] as Type; 235Type enumBaseType2 = reference.UserData[typeof(Enum)] as Type;
AuthoringOM\Compiler\TypeSystem\TypeProvider.cs (2)
786return TypeProvider.IsSubclassOf(type, typeof(Enum)); 793if (!TypeProvider.IsSubclassOf(enumType, typeof(Enum)))
AuthoringOM\Compiler\Validation\CompositeActivityValidator.cs (1)
62return new ValidationError(SR.GetString(SR.Error_DynamicActivity, activity.QualifiedName, Enum.GetName(typeof(ActivityExecutionStatus), activity.ExecutionStatus)), ErrorNumbers.Error_DynamicActivity);
AuthoringOM\DependencyProperty.cs (1)
247Array values = Enum.GetValues(propertyType);
AuthoringOM\Design\ActivityDesignerLayoutSerializers.cs (2)
226DesignerEdges sourceEdge = (DesignerEdges)Enum.Parse(typeof(DesignerEdges), constructionArguments["SourceConnectionEdge"] as string); 237DesignerEdges targetEdge = (DesignerEdges)Enum.Parse(typeof(DesignerEdges), constructionArguments["TargetConnectionEdge"] as string);
AuthoringOM\Design\Themes.cs (2)
348themeType = (ThemeType)Enum.Parse(typeof(ThemeType), (string)registryValue, true); 3260return Enum.Parse(context.PropertyDescriptor.PropertyType, (string)value);
AuthoringOM\Serializer\WorkflowMarkupSerializer.cs (1)
1248propVal = Enum.Parse(propertyType, value, true);
System.Workflow.Runtime (7)
Tracking\TrackingProfileSerializer.cs (7)
476point.MatchingLocation.Events.Add((TrackingWorkflowEvent)Enum.Parse(typeof(TrackingWorkflowEvent), reader.ReadString())); 518string[] names = Enum.GetNames(typeof(ActivityExecutionStatus)); 522events.Add((ActivityExecutionStatus)Enum.Parse(typeof(ActivityExecutionStatus), status)); 609string[] names = Enum.GetNames(typeof(ComparisonOperator)); 613condition.Operator = (ComparisonOperator)Enum.Parse(typeof(ComparisonOperator), op); 1307foreach (ActivityExecutionStatus s in Enum.GetValues(typeof(ActivityExecutionStatus))) 1337foreach (TrackingWorkflowEvent s in Enum.GetValues(typeof(TrackingWorkflowEvent)))
System.Xml (17)
System\Xml\Serialization\CodeGenerator.cs (3)
1050Ldc(((IConvertible)o).ToType(Enum.GetUnderlyingType(valueType), null)); 1435Ldelem(Enum.GetUnderlyingType(arrayElementType)); 1512Stelem(Enum.GetUnderlyingType(arrayElementType));
System\Xml\Serialization\SoapReflectionImporter.cs (2)
692string strValue = Enum.Format(a.SoapDefaultValue.GetType(), a.SoapDefaultValue, "G").Replace(",", " "); 693string numValue = Enum.Format(a.SoapDefaultValue.GetType(), a.SoapDefaultValue, "D");
System\Xml\Serialization\XmlCodeExporter.cs (1)
790attribute.Arguments.Add(new CodeAttributeArgument("Form", new CodeFieldReferenceExpression(new CodeTypeReferenceExpression(typeof(XmlSchemaForm).FullName), Enum.Format(typeof(XmlSchemaForm), form, "G"))));
System\Xml\Serialization\XmlReflectionImporter.cs (2)
1867string strValue = Enum.Format(t, a.XmlDefaultValue, "G").Replace(",", " "); 1868string numValue = Enum.Format(t, a.XmlDefaultValue, "D");
System\Xml\Serialization\XmlSerializationReader.cs (1)
2815Writer.Write(typeof(Enum).FullName);
System\Xml\Serialization\XmlSerializationReaderILGen.cs (3)
1022ilg.Ldc(Enum.ToObject(mapping.TypeDesc.Type, constants[i].Value)); 1057underlyingType = Enum.GetUnderlyingType(returnType); 1123retValues.Add(Enum.ToObject(mapping.TypeDesc.Type, c.Value));
System\Xml\Serialization\XmlSerializationWriterILGen.cs (5)
200ilg.Ldc(Enum.Parse(mapping.TypeDesc.Type, enumDefaultValue, false)); 587ilg.Ldc(Enum.ToObject(mapping.TypeDesc.Type, c.Value)); 2181eValue = Enum.ToObject(choiceMapping.TypeDesc.Type, choiceMapping.Constants[i].Value); 2193eValue = Enum.ToObject(choiceMapping.TypeDesc.Type, choiceMapping.Constants[i].Value); 2277ilg.Ldc(Enum.Parse(type, memberName, false));
UIAutomationClient (1)
System\Windows\Automation\Text\TextRange.cs (1)
259obj = Enum.ToObject(ai.Type, (int)obj);
UIAutomationClientsideProviders (2)
MS\Internal\AutomationProxies\WindowsEditBoxRange.cs (1)
199if (targetAttribute is Enum)
MS\Internal\AutomationProxies\WindowsRichEditRange.cs (1)
463else if (v2 is Enum)
WindowsBase (19)
Base\MS\Internal\AssemblyHelper.cs (1)
61string[] names = Enum.GetNames(typeof(UncommonAssembly));
Base\MS\Internal\IO\Packaging\CompoundFile\RightsManagementEncryptionTransform.cs (2)
1158Enum.GetName(typeof(AuthenticationType), AuthenticationType.Windows))) 1165Enum.GetName(typeof(AuthenticationType), AuthenticationType.Passport)))
Base\MS\Internal\IO\Packaging\InternalRelationshipCollection.cs (1)
387relationshipTargetMode = (TargetMode)(Enum.Parse(typeof(TargetMode), targetModeAttributeValue, false /* ignore case */));
Base\MS\Internal\IO\Zip\ZipIOLocalFileBlock.cs (2)
393Debug.Assert(Enum.IsDefined(typeof(CompressionMethodEnum), compressionMethod)); 394Debug.Assert(Enum.IsDefined(typeof(DeflateOptionEnum), deflateOption));
Base\MS\Internal\IO\Zip\ZipIOLocalFileHeader.cs (3)
51Debug.Assert(Enum.IsDefined(typeof(CompressionMethodEnum), compressionMethod)); 52Debug.Assert(Enum.IsDefined(typeof(DeflateOptionEnum), deflateOption)); 303Debug.Assert(Enum.IsDefined(typeof(DeflateOptionEnum), value));
Base\System\IO\Packaging\ZipPackage.cs (2)
597Debug.Assert(Enum.IsDefined(typeof(CompressionMethodEnum), zipFileInfo.CompressionMethod), "Enum value is not in range"); 598Debug.Assert(Enum.IsDefined(typeof(DeflateOptionEnum), zipFileInfo.DeflateOption), "Enum value is not in range");
Base\System\Security\Permissions\MediaPermission.cs (3)
420_mediaPermissionAudio = (MediaPermissionAudio)Enum.Parse(typeof(MediaPermissionAudio), audio ); 431_mediaPermissionVideo = (MediaPermissionVideo)Enum.Parse(typeof(MediaPermissionVideo), video ); 442_mediaPermissionImage = (MediaPermissionImage)Enum.Parse(typeof(MediaPermissionImage), image );
Base\System\Security\Permissions\WebBrowserPermission.cs (1)
280_webBrowserPermissionLevel = (WebBrowserPermissionLevel)Enum.Parse(typeof(WebBrowserPermissionLevel), level);
Base\System\Windows\BaseCompatibilityPreferences.cs (1)
348if (Enum.TryParse(s, true, out value))
Base\System\Windows\Input\KeyConverter.cs (1)
221default: keyFound = (Key)Enum.Parse(typeof(Key), keyToken, true); break;
Shared\MS\Utility\TraceProvider.cs (1)
293data = Convert.ChangeType(data, Enum.GetUnderlyingType(dataType), CultureInfo.InvariantCulture);
Shared\MS\Win32\SafeNativeMethodsCLR.cs (1)
542if (Enum.IsDefined(typeof(NativeMethods.WTS_CONNECTSTATE_CLASS), data))
XamlBuildTask (2)
Microsoft\Build\Tasks\Xaml\NamedObject.cs (1)
32if (!Enum.IsDefined(typeof(MemberVisibility), value))
Microsoft\Build\Tasks\Xaml\PropertyData.cs (1)
44if (!Enum.IsDefined(typeof(MemberVisibility), value))