Code:
/ Dotnetfx_Win7_3.5.1 / Dotnetfx_Win7_3.5.1 / 3.5.1 / DEVDIV / depot / DevDiv / releases / whidbey / NetFXspW7 / ndp / fx / src / Services / Monitoring / system / Diagnosticts / AlphabeticalEnumConverter.cs / 1 / AlphabeticalEnumConverter.cs
//------------------------------------------------------------------------------ //// Copyright (c) Microsoft Corporation. All rights reserved. // //----------------------------------------------------------------------------- namespace System.Diagnostics { using System.Collections; using System.ComponentModel; using System; using System.Globalization; ////// /// internal class AlphabeticalEnumConverter : EnumConverter { public AlphabeticalEnumConverter(Type type) : base(type) { } public override StandardValuesCollection GetStandardValues(ITypeDescriptorContext context) { if (Values == null) { Array objValues = Enum.GetValues(EnumType); //IComparer comparer = Comparer; object[] names = new object[objValues.Length]; for (int i = 0; i < names.Length; i++) names[i] = ConvertTo(context, null, objValues.GetValue(i), typeof(string)); Array.Sort(names, objValues, 0, objValues.Length, System.Collections.Comparer.Default); Values = new StandardValuesCollection(objValues); } return Values; } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. //------------------------------------------------------------------------------ ///// Provides a type converter to /// convert ???? objects to and from various other representations. /// ///// Copyright (c) Microsoft Corporation. All rights reserved. // //----------------------------------------------------------------------------- namespace System.Diagnostics { using System.Collections; using System.ComponentModel; using System; using System.Globalization; ////// /// internal class AlphabeticalEnumConverter : EnumConverter { public AlphabeticalEnumConverter(Type type) : base(type) { } public override StandardValuesCollection GetStandardValues(ITypeDescriptorContext context) { if (Values == null) { Array objValues = Enum.GetValues(EnumType); //IComparer comparer = Comparer; object[] names = new object[objValues.Length]; for (int i = 0; i < names.Length; i++) names[i] = ConvertTo(context, null, objValues.GetValue(i), typeof(string)); Array.Sort(names, objValues, 0, objValues.Length, System.Collections.Comparer.Default); Values = new StandardValuesCollection(objValues); } return Values; } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007./// Provides a type converter to /// convert ???? objects to and from various other representations. /// ///
Link Menu
![Network programming in C#, Network Programming in VB.NET, Network Programming in .NET](/images/book.jpg)
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- Point3DKeyFrameCollection.cs
- HttpResponseHeader.cs
- Version.cs
- ToolBarTray.cs
- SqlExpressionNullability.cs
- AppSettingsSection.cs
- FileEnumerator.cs
- HttpResponse.cs
- GridViewCommandEventArgs.cs
- GridViewDeleteEventArgs.cs
- ContentPosition.cs
- SymbolEqualComparer.cs
- StateChangeEvent.cs
- LineInfo.cs
- DataGridColumnCollection.cs
- DetailsViewModeEventArgs.cs
- SqlTransaction.cs
- InternalCache.cs
- FileChangesMonitor.cs
- HtmlDocument.cs
- DataSetFieldSchema.cs
- XmlnsDefinitionAttribute.cs
- Transform.cs
- UnsafeNativeMethodsCLR.cs
- AdornedElementPlaceholder.cs
- DataGridViewUtilities.cs
- BinaryParser.cs
- CngProvider.cs
- Point4D.cs
- FileLogRecordHeader.cs
- SafeRegistryKey.cs
- QueryTask.cs
- XNodeValidator.cs
- SqlDataSourceFilteringEventArgs.cs
- Operator.cs
- GroupQuery.cs
- SoapCodeExporter.cs
- DiscoveryEndpoint.cs
- Zone.cs
- UIAgentAsyncEndRequest.cs
- SelectingProviderEventArgs.cs
- NativeMethods.cs
- MultipleViewPattern.cs
- PageEventArgs.cs
- XmlExpressionDumper.cs
- PropertyTabChangedEvent.cs
- DataGridDesigner.cs
- XmlSchemaValidator.cs
- SiteMapHierarchicalDataSourceView.cs
- ClientBuildManagerCallback.cs
- SchemaMapping.cs
- EncodingInfo.cs
- BufferedGraphicsManager.cs
- Transform.cs
- XmlElementList.cs
- PartialList.cs
- RootProfilePropertySettingsCollection.cs
- Profiler.cs
- ProfessionalColorTable.cs
- SQLInt32Storage.cs
- CompilationRelaxations.cs
- XmlUtil.cs
- RuleCache.cs
- ProvidersHelper.cs
- DefaultValueTypeConverter.cs
- ColumnBinding.cs
- SynchronizedKeyedCollection.cs
- MulticastIPAddressInformationCollection.cs
- QueryGenerator.cs
- FontFamily.cs
- ConditionalAttribute.cs
- CircleHotSpot.cs
- Message.cs
- dataSvcMapFileLoader.cs
- HttpWebRequest.cs
- ProxyDataContractResolver.cs
- EventLogPermissionEntry.cs
- WebServiceErrorEvent.cs
- AccessViolationException.cs
- TrackingRecord.cs
- CreateSequenceResponse.cs
- CodeTypeReference.cs
- OleDbDataReader.cs
- SqlWorkflowPersistenceService.cs
- FileVersionInfo.cs
- Serializer.cs
- InputChannelAcceptor.cs
- WebPartsPersonalizationAuthorization.cs
- TargetControlTypeAttribute.cs
- BuiltInPermissionSets.cs
- PocoEntityKeyStrategy.cs
- HttpWebRequest.cs
- DesignerDataSchemaClass.cs
- Axis.cs
- XsdBuildProvider.cs
- ExpressionConverter.cs
- GenerateHelper.cs
- Intellisense.cs
- InternalControlCollection.cs
- TypeDescriptorContext.cs