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
- HttpFileCollection.cs
- CombinedTcpChannel.cs
- ApplicationFileCodeDomTreeGenerator.cs
- SQLString.cs
- TogglePattern.cs
- TemplateBamlRecordReader.cs
- HybridDictionary.cs
- sqlmetadatafactory.cs
- Inline.cs
- SmtpNetworkElement.cs
- UnhandledExceptionEventArgs.cs
- _ListenerResponseStream.cs
- ItemList.cs
- HandoffBehavior.cs
- OracleBoolean.cs
- FormatterConverter.cs
- SystemDiagnosticsSection.cs
- RegexFCD.cs
- EncoderReplacementFallback.cs
- XmlAttributeCollection.cs
- MediaElementAutomationPeer.cs
- WCFServiceClientProxyGenerator.cs
- TypeSystem.cs
- SqlDataSourceCache.cs
- XmlNamespaceDeclarationsAttribute.cs
- EntityDesignerBuildProvider.cs
- ArrangedElement.cs
- DateTimeSerializationSection.cs
- UnsafeNativeMethods.cs
- InvokeBinder.cs
- SingleConverter.cs
- DataObjectSettingDataEventArgs.cs
- DataTransferEventArgs.cs
- UnmanagedHandle.cs
- EventToken.cs
- LoginUtil.cs
- MessageBox.cs
- SelectionUIHandler.cs
- OutputWindow.cs
- DataGridViewHitTestInfo.cs
- InstanceKey.cs
- UnionCodeGroup.cs
- SafeEventLogReadHandle.cs
- ContentTypeSettingClientMessageFormatter.cs
- XmlILModule.cs
- SqlConnectionManager.cs
- StorageInfo.cs
- AttributeEmitter.cs
- _HelperAsyncResults.cs
- ActivityExecutorSurrogate.cs
- XPathAncestorQuery.cs
- WindowsBrush.cs
- DescendantQuery.cs
- MaskDescriptors.cs
- util.cs
- OleCmdHelper.cs
- ClientEventManager.cs
- UnSafeCharBuffer.cs
- ResourceAssociationTypeEnd.cs
- PriorityBindingExpression.cs
- ObjectViewEntityCollectionData.cs
- SafeViewOfFileHandle.cs
- RenderDataDrawingContext.cs
- Rotation3DKeyFrameCollection.cs
- ApplicationException.cs
- SafePEFileHandle.cs
- EventProviderWriter.cs
- RootNamespaceAttribute.cs
- Char.cs
- UpdatePanel.cs
- WebPartManager.cs
- BlobPersonalizationState.cs
- SessionStateModule.cs
- ToolStripPanelDesigner.cs
- WindowsToolbar.cs
- filewebresponse.cs
- CodeTypeOfExpression.cs
- EdmItemError.cs
- Focus.cs
- ProviderUtil.cs
- SplitContainerDesigner.cs
- WebControlParameterProxy.cs
- FlowLayout.cs
- ClientApiGenerator.cs
- HwndKeyboardInputProvider.cs
- WebReferencesBuildProvider.cs
- StringSorter.cs
- ArrayWithOffset.cs
- InfoCardRSACryptoProvider.cs
- DataGridViewImageCell.cs
- DbConnectionStringBuilder.cs
- BitmapEffectInput.cs
- XmlCollation.cs
- ItemsControl.cs
- BlockCollection.cs
- DataSourceSelectArguments.cs
- CodePrimitiveExpression.cs
- XmlBoundElement.cs
- AppDomainProtocolHandler.cs
- TemplateInstanceAttribute.cs