Code:
/ Net / Net / 3.5.50727.3053 / DEVDIV / depot / DevDiv / releases / whidbey / netfxsp / 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
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- ModuleBuilderData.cs
- TextBoxBase.cs
- HiddenField.cs
- XamlWriter.cs
- LinkUtilities.cs
- TreeViewImageKeyConverter.cs
- TextOnlyOutput.cs
- RadioButtonFlatAdapter.cs
- DataGridViewCellStyleContentChangedEventArgs.cs
- MinimizableAttributeTypeConverter.cs
- ReferenceTypeElement.cs
- WebPart.cs
- ListBindingHelper.cs
- PrintDocument.cs
- XmlAnyAttributeAttribute.cs
- DataServiceEntityAttribute.cs
- ListManagerBindingsCollection.cs
- StringValueSerializer.cs
- RequestChannelBinder.cs
- DockPanel.cs
- EmptyCollection.cs
- BrowserDefinition.cs
- ValueChangedEventManager.cs
- HostingPreferredMapPath.cs
- CreateDataSourceDialog.cs
- SpellCheck.cs
- EventTask.cs
- ClientSettingsStore.cs
- UdpDiscoveryEndpointElement.cs
- FolderNameEditor.cs
- ChineseLunisolarCalendar.cs
- PageThemeBuildProvider.cs
- DataMemberConverter.cs
- SaveFileDialog.cs
- BlobPersonalizationState.cs
- X509CertificateValidationMode.cs
- MsmqInputChannelListener.cs
- X509InitiatorCertificateClientElement.cs
- CodeDOMUtility.cs
- DPAPIProtectedConfigurationProvider.cs
- Profiler.cs
- KeyConverter.cs
- ScriptControlDescriptor.cs
- DeferredElementTreeState.cs
- NavigationPropertyAccessor.cs
- AffineTransform3D.cs
- GPRECT.cs
- PassportIdentity.cs
- ConstraintCollection.cs
- HttpHandlerActionCollection.cs
- ZoneIdentityPermission.cs
- Script.cs
- BamlLocalizabilityResolver.cs
- WindowsRichEditRange.cs
- NumberFunctions.cs
- SpeechRecognitionEngine.cs
- PageBuildProvider.cs
- SequenceFullException.cs
- DataSourceXmlSerializationAttribute.cs
- StrongNameKeyPair.cs
- GeometryDrawing.cs
- ZipFileInfoCollection.cs
- AutomationElement.cs
- EntityTypeEmitter.cs
- querybuilder.cs
- ThreadExceptionDialog.cs
- GridViewUpdateEventArgs.cs
- WebPartDeleteVerb.cs
- CancellationTokenSource.cs
- LongTypeConverter.cs
- DbParameterHelper.cs
- BooleanSwitch.cs
- PasswordRecovery.cs
- Matrix.cs
- TypeBuilder.cs
- InvalidWMPVersionException.cs
- Keyboard.cs
- ColorTransformHelper.cs
- StorageRoot.cs
- FastPropertyAccessor.cs
- StorageMappingItemLoader.cs
- ListViewPagedDataSource.cs
- GetResponse.cs
- BatchServiceHost.cs
- WindowsPrincipal.cs
- FullTextLine.cs
- StrokeNodeOperations2.cs
- SmiContextFactory.cs
- XamlBrushSerializer.cs
- FrameworkElementFactoryMarkupObject.cs
- EndPoint.cs
- CheckStoreFileValidityRequest.cs
- Pointer.cs
- SchemaInfo.cs
- DynamicAttribute.cs
- DataSourceCache.cs
- TypedTableGenerator.cs
- ConfigurationPropertyCollection.cs
- filewebresponse.cs
- TransferRequestHandler.cs