Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / Services / Monitoring / system / Diagnosticts / AlphabeticalEnumConverter.cs / 1305376 / 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

This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- GroupItemAutomationPeer.cs
- ObjectViewEntityCollectionData.cs
- ZoneMembershipCondition.cs
- XamlSerializerUtil.cs
- ToolboxItemFilterAttribute.cs
- Events.cs
- EventProviderWriter.cs
- GenericTextProperties.cs
- RequestCacheEntry.cs
- LicFileLicenseProvider.cs
- mactripleDES.cs
- TransactionFlowBindingElement.cs
- MailAddress.cs
- ProgressPage.cs
- ServicesUtilities.cs
- ColorContext.cs
- RectangleConverter.cs
- SQLBinaryStorage.cs
- SQLInt64.cs
- DataListCommandEventArgs.cs
- XDRSchema.cs
- UnauthorizedAccessException.cs
- SqlBooleanizer.cs
- StatusBarPanel.cs
- Control.cs
- CryptoHelper.cs
- DataGridRelationshipRow.cs
- FixedPageStructure.cs
- XmlSchemaObjectTable.cs
- DrawingCollection.cs
- RequiredArgumentAttribute.cs
- SqlClientWrapperSmiStream.cs
- EnumValAlphaComparer.cs
- SupportingTokenDuplexChannel.cs
- ModifiableIteratorCollection.cs
- JsonXmlDataContract.cs
- CodeDirectoryCompiler.cs
- X509Certificate.cs
- FixedElement.cs
- CapabilitiesRule.cs
- FormsIdentity.cs
- List.cs
- NextPreviousPagerField.cs
- XmlWriterDelegator.cs
- Compiler.cs
- EntityDataSourceValidationException.cs
- AppendHelper.cs
- Rectangle.cs
- IsolatedStorageException.cs
- GeneralTransform3DTo2D.cs
- TableLayoutSettings.cs
- FullTextState.cs
- SqlDataSourceStatusEventArgs.cs
- CustomCredentialPolicy.cs
- ContractNamespaceAttribute.cs
- ToolStripItemRenderEventArgs.cs
- TransformerTypeCollection.cs
- RequestCacheEntry.cs
- WebServiceResponse.cs
- TextEffect.cs
- TextLineBreak.cs
- StylusPoint.cs
- LogEntrySerialization.cs
- ISessionStateStore.cs
- DataGridColumn.cs
- XmlTypeAttribute.cs
- Base64Stream.cs
- ItemMap.cs
- SqlDataSourceStatusEventArgs.cs
- TextBoxAutoCompleteSourceConverter.cs
- QueryExpr.cs
- ValueQuery.cs
- InternalConfirm.cs
- MutexSecurity.cs
- InvariantComparer.cs
- ListView.cs
- NotCondition.cs
- BordersPage.cs
- FilterEventArgs.cs
- QueryReaderSettings.cs
- ImportCatalogPart.cs
- UshortList2.cs
- wgx_render.cs
- LicenseProviderAttribute.cs
- ObjectDataSource.cs
- AlignmentYValidation.cs
- TreePrinter.cs
- MasterPageCodeDomTreeGenerator.cs
- followingquery.cs
- StickyNoteHelper.cs
- SafeNativeMethods.cs
- RequestStatusBarUpdateEventArgs.cs
- HttpListenerResponse.cs
- UseManagedPresentationBindingElement.cs
- SettingsPropertyValue.cs
- ContentDisposition.cs
- ZoneButton.cs
- EUCJPEncoding.cs
- XmlSchemaImport.cs
- InfoCardConstants.cs