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
- SchemaConstraints.cs
- SqlDependency.cs
- XPathDocumentNavigator.cs
- AppDomainEvidenceFactory.cs
- SafeNativeMethods.cs
- WrappedIUnknown.cs
- XmlSchemaDatatype.cs
- XamlTypeMapper.cs
- Expander.cs
- Vector3dCollection.cs
- GenericAuthenticationEventArgs.cs
- ApplicationServicesHostFactory.cs
- MimeReturn.cs
- XpsFontSerializationService.cs
- IPAddressCollection.cs
- ApplicationServiceHelper.cs
- StreamingContext.cs
- Subtree.cs
- IdentifierCollection.cs
- ProvidePropertyAttribute.cs
- MainMenu.cs
- AuthorizationSection.cs
- Compilation.cs
- HtmlEmptyTagControlBuilder.cs
- SqlCacheDependencyDatabase.cs
- SizeLimitedCache.cs
- XamlPointCollectionSerializer.cs
- QueryAccessibilityHelpEvent.cs
- NegotiateStream.cs
- WhitespaceRuleLookup.cs
- Padding.cs
- Sequence.cs
- SqlRecordBuffer.cs
- PrintPreviewControl.cs
- UserMapPath.cs
- TextContainerChangeEventArgs.cs
- SelectionWordBreaker.cs
- DocumentApplicationJournalEntry.cs
- ReferencedAssembly.cs
- DataBoundControlAdapter.cs
- ArrayWithOffset.cs
- SystemIPInterfaceProperties.cs
- FieldNameLookup.cs
- PLINQETWProvider.cs
- Style.cs
- Int32.cs
- DataRowComparer.cs
- NavigationService.cs
- ScaleTransform3D.cs
- DiagnosticsConfigurationHandler.cs
- QuaternionValueSerializer.cs
- FileSystemEnumerable.cs
- UrlPath.cs
- ControlFilterExpression.cs
- OptimisticConcurrencyException.cs
- InteropTrackingRecord.cs
- DeviceSpecificChoiceCollection.cs
- Debugger.cs
- unsafeIndexingFilterStream.cs
- MetadataArtifactLoader.cs
- ModelItemDictionary.cs
- WmpBitmapEncoder.cs
- SystemIPGlobalProperties.cs
- SerializationInfo.cs
- SingleAnimation.cs
- CompositeControlDesigner.cs
- IsolatedStorageFileStream.cs
- ISessionStateStore.cs
- UnmanagedMemoryStream.cs
- AgileSafeNativeMemoryHandle.cs
- MustUnderstandSoapException.cs
- MruCache.cs
- ExtendLockAsyncResult.cs
- ScrollProviderWrapper.cs
- HttpsTransportBindingElement.cs
- DynamicRenderer.cs
- ObjectQuery_EntitySqlExtensions.cs
- TransformProviderWrapper.cs
- BrowserCapabilitiesCodeGenerator.cs
- RuntimeHandles.cs
- DocumentNUp.cs
- AssemblyResourceLoader.cs
- ColorTranslator.cs
- ObservableDictionary.cs
- ColumnWidthChangingEvent.cs
- AuthenticatingEventArgs.cs
- Parser.cs
- IsolatedStoragePermission.cs
- remotingproxy.cs
- CellConstantDomain.cs
- XPathDocument.cs
- ListSortDescriptionCollection.cs
- RuleRefElement.cs
- CultureTableRecord.cs
- HttpGetServerProtocol.cs
- CaseInsensitiveOrdinalStringComparer.cs
- FixedDSBuilder.cs
- DataControlFieldHeaderCell.cs
- WindowsFormsSectionHandler.cs
- SchemaConstraints.cs