Code:
/ FX-1434 / FX-1434 / 1.0 / untmp / whidbey / REDBITS / 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; } } }/// 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
- SafeProcessHandle.cs
- MarkedHighlightComponent.cs
- SafeLibraryHandle.cs
- EditorZone.cs
- InputReport.cs
- IProvider.cs
- ArrayExtension.cs
- MenuItemBindingCollection.cs
- shaperfactory.cs
- UnsafeNativeMethods.cs
- XappLauncher.cs
- LinkedList.cs
- DataGridColumnHeaderAutomationPeer.cs
- LocalizableAttribute.cs
- SmiSettersStream.cs
- DbProviderManifest.cs
- MultiAsyncResult.cs
- BoundPropertyEntry.cs
- IgnoreDeviceFilterElement.cs
- KeyFrames.cs
- HttpClientChannel.cs
- HttpResponse.cs
- DefaultObjectSerializer.cs
- PanelStyle.cs
- VideoDrawing.cs
- SafeCryptHandles.cs
- EntityClassGenerator.cs
- VectorAnimationUsingKeyFrames.cs
- ConnectionManagementSection.cs
- PageSettings.cs
- XPathNavigator.cs
- DefaultValueTypeConverter.cs
- DbReferenceCollection.cs
- PrintingPermissionAttribute.cs
- GenericTextProperties.cs
- Attachment.cs
- SchemaTableOptionalColumn.cs
- SrgsElement.cs
- BaseTemplateBuildProvider.cs
- ListDictionary.cs
- Scene3D.cs
- WebSysDisplayNameAttribute.cs
- DetailsViewDesigner.cs
- Duration.cs
- String.cs
- PlainXmlWriter.cs
- PreviewPageInfo.cs
- DbSetClause.cs
- SqlXml.cs
- BooleanStorage.cs
- Codec.cs
- NameValuePair.cs
- BitArray.cs
- XmlSerializerFactory.cs
- ReadOnlyPermissionSet.cs
- DataGridPreparingCellForEditEventArgs.cs
- Help.cs
- WindowsGraphicsCacheManager.cs
- MetadataArtifactLoaderCompositeFile.cs
- BindingOperations.cs
- Asn1IntegerConverter.cs
- HttpListenerException.cs
- WebPartManager.cs
- TagPrefixCollection.cs
- ViewSimplifier.cs
- xmlfixedPageInfo.cs
- TextSegment.cs
- DriveNotFoundException.cs
- BamlMapTable.cs
- CatalogPartCollection.cs
- EventLogTraceListener.cs
- Win32PrintDialog.cs
- InfocardClientCredentials.cs
- SpeechEvent.cs
- _ConnectStream.cs
- JsonDataContract.cs
- TaskDesigner.cs
- TreeNodeMouseHoverEvent.cs
- EDesignUtil.cs
- MethodToken.cs
- XhtmlTextWriter.cs
- StdValidatorsAndConverters.cs
- StoreItemCollection.cs
- OperationAbortedException.cs
- WebBrowser.cs
- TextFormattingConverter.cs
- HtmlTableRow.cs
- GridViewEditEventArgs.cs
- ToolTipAutomationPeer.cs
- RawStylusInputReport.cs
- DataGridItemCollection.cs
- PeerContact.cs
- Brush.cs
- Win32NamedPipes.cs
- OpenFileDialog.cs
- RegisteredArrayDeclaration.cs
- RegisteredExpandoAttribute.cs
- FixedDSBuilder.cs
- MsmqAuthenticationMode.cs
- IssuedTokenClientCredential.cs