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
- RelOps.cs
- CompositeControl.cs
- PatternMatcher.cs
- CodeTypeMemberCollection.cs
- StateMachine.cs
- IisTraceWebEventProvider.cs
- AuthenticationService.cs
- Soap12ProtocolReflector.cs
- HopperCache.cs
- RequestTimeoutManager.cs
- TypeUtil.cs
- RegionInfo.cs
- SqlProvider.cs
- Permission.cs
- SafeIUnknown.cs
- PeerOutputChannel.cs
- SqlAliaser.cs
- StylusPointProperties.cs
- ProxyAttribute.cs
- HttpPostProtocolReflector.cs
- ContentType.cs
- TcpClientSocketManager.cs
- SettingsPropertyNotFoundException.cs
- SafeNativeMethods.cs
- ScriptDescriptor.cs
- TemplateColumn.cs
- MimeBasePart.cs
- WorkflowServiceHost.cs
- PerformanceCounterNameAttribute.cs
- ItemsPanelTemplate.cs
- SetStateEventArgs.cs
- PackageRelationshipSelector.cs
- Win32PrintDialog.cs
- ProfessionalColorTable.cs
- InvalidEnumArgumentException.cs
- WeakReadOnlyCollection.cs
- WindowsIPAddress.cs
- SynchronizedDisposablePool.cs
- NativeMethods.cs
- filewebrequest.cs
- EnumerableRowCollection.cs
- RoutedEventHandlerInfo.cs
- Command.cs
- FunctionCommandText.cs
- ClosableStream.cs
- RequiredFieldValidator.cs
- WorkflowDataContext.cs
- RuntimeConfig.cs
- CompositeCollectionView.cs
- IDReferencePropertyAttribute.cs
- FontDifferentiator.cs
- PeerDefaultCustomResolverClient.cs
- BitmapImage.cs
- _ProxyRegBlob.cs
- InputReport.cs
- ListenerConnectionModeReader.cs
- StringResourceManager.cs
- DbDataSourceEnumerator.cs
- Point3D.cs
- RemoteWebConfigurationHost.cs
- Timer.cs
- ClassicBorderDecorator.cs
- StrokeNodeOperations2.cs
- RtfFormatStack.cs
- HtmlTernaryTree.cs
- View.cs
- RoleService.cs
- DriveInfo.cs
- BitmapCacheBrush.cs
- RawStylusInputCustomDataList.cs
- SharedDp.cs
- DocumentPageViewAutomationPeer.cs
- EdmToObjectNamespaceMap.cs
- XmlEntity.cs
- ClientCredentialsElement.cs
- EDesignUtil.cs
- SqlXml.cs
- AssemblySettingAttributes.cs
- BaseCodeDomTreeGenerator.cs
- WorkflowOwnershipException.cs
- SnapLine.cs
- ThicknessAnimationUsingKeyFrames.cs
- X509ServiceCertificateAuthentication.cs
- PathSegmentCollection.cs
- SoapHelper.cs
- WorkflowServiceBuildProvider.cs
- GacUtil.cs
- CommandLibraryHelper.cs
- EncodingFallbackAwareXmlTextWriter.cs
- AccessText.cs
- XmlAttributeOverrides.cs
- KeyboardNavigation.cs
- ClipboardProcessor.cs
- Shared.cs
- Certificate.cs
- StylusEventArgs.cs
- EpmCustomContentDeSerializer.cs
- PassportAuthenticationEventArgs.cs
- ContextMenuAutomationPeer.cs
- PerformanceCounterManager.cs