Code:
/ Dotnetfx_Vista_SP2 / Dotnetfx_Vista_SP2 / 8.0.50727.4016 / DEVDIV / depot / DevDiv / releases / whidbey / NetFxQFE / 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
- DetailsViewRowCollection.cs
- SqlAggregateChecker.cs
- EntityDesignerDataSourceView.cs
- DataGridViewColumnDesignTimeVisibleAttribute.cs
- mediapermission.cs
- WindowsClaimSet.cs
- X509Extension.cs
- AsymmetricSignatureDeformatter.cs
- GeneralTransform3D.cs
- CredentialManagerDialog.cs
- Rect3DValueSerializer.cs
- RegexCapture.cs
- NewArray.cs
- ZipIOZip64EndOfCentralDirectoryLocatorBlock.cs
- CacheAxisQuery.cs
- DirectoryObjectSecurity.cs
- SplineKeyFrames.cs
- AssemblyBuilderData.cs
- DefaultObjectMappingItemCollection.cs
- XmlWriterTraceListener.cs
- TreeNode.cs
- NonVisualControlAttribute.cs
- BehaviorEditorPart.cs
- FrameworkContextData.cs
- _UncName.cs
- AsymmetricAlgorithm.cs
- ExpressionLink.cs
- SqlDependencyUtils.cs
- FixedSOMTableRow.cs
- HttpClientCertificate.cs
- BitArray.cs
- WorkflowCreationContext.cs
- ClientRuntimeConfig.cs
- controlskin.cs
- GetLedgerRequest.cs
- PropertyGrid.cs
- ReadOnlyHierarchicalDataSource.cs
- ExtensionQuery.cs
- ControllableStoryboardAction.cs
- BevelBitmapEffect.cs
- RawAppCommandInputReport.cs
- HTTPNotFoundHandler.cs
- AnnotationHighlightLayer.cs
- WorkflowRuntimeServiceElement.cs
- FrameSecurityDescriptor.cs
- LogLogRecord.cs
- BitmapVisualManager.cs
- StyleHelper.cs
- FunctionMappingTranslator.cs
- CheckBox.cs
- UrlMappingsSection.cs
- DataObjectPastingEventArgs.cs
- SafeHandles.cs
- Visual3D.cs
- DiscoveryClientReferences.cs
- CryptoApi.cs
- CodeAttributeArgumentCollection.cs
- CircleHotSpot.cs
- EventMappingSettings.cs
- DataGridViewCellValidatingEventArgs.cs
- RegexCode.cs
- RSAOAEPKeyExchangeFormatter.cs
- QueryCacheEntry.cs
- httpserverutility.cs
- Config.cs
- PreloadHost.cs
- ValuePatternIdentifiers.cs
- XmlSiteMapProvider.cs
- PagerSettings.cs
- BitmapSourceSafeMILHandle.cs
- ImageAnimator.cs
- SystemIPInterfaceStatistics.cs
- XPathEmptyIterator.cs
- ReferenceEqualityComparer.cs
- PageCatalogPart.cs
- ScrollChrome.cs
- SqlDataSourceEnumerator.cs
- ControlAdapter.cs
- ProfessionalColors.cs
- ComplexBindingPropertiesAttribute.cs
- BitmapEffectGroup.cs
- XmlSchemaValidator.cs
- EntityDataReader.cs
- TraceUtility.cs
- IPGlobalProperties.cs
- SupportingTokenDuplexChannel.cs
- XmlWrappingReader.cs
- DropSource.cs
- LabelLiteral.cs
- LocalIdKeyIdentifierClause.cs
- LineServicesRun.cs
- BitmapMetadataEnumerator.cs
- RootProfilePropertySettingsCollection.cs
- GlyphingCache.cs
- UInt32Storage.cs
- IdnElement.cs
- EllipseGeometry.cs
- WasNotInstalledException.cs
- GeneralTransform3DGroup.cs
- MetadataArtifactLoaderCompositeResource.cs