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
- RegexMatchCollection.cs
- QueueProcessor.cs
- List.cs
- WebEventTraceProvider.cs
- GridViewRow.cs
- IntSecurity.cs
- RuleConditionDialog.Designer.cs
- Substitution.cs
- BufferedMessageData.cs
- ToolStripComboBox.cs
- DiscoveryDocumentSearchPattern.cs
- AuthenticationModuleElementCollection.cs
- HtmlInputControl.cs
- SafeJobHandle.cs
- DiagnosticsConfigurationHandler.cs
- ActiveXHelper.cs
- _RequestLifetimeSetter.cs
- TimersDescriptionAttribute.cs
- DesignerMetadata.cs
- TextSegment.cs
- TrackingStringDictionary.cs
- BevelBitmapEffect.cs
- TypeSource.cs
- ObjectNavigationPropertyMapping.cs
- SafeNativeMemoryHandle.cs
- ResXFileRef.cs
- XmlArrayItemAttributes.cs
- DataRecordInfo.cs
- UpdateManifestForBrowserApplication.cs
- DataListItem.cs
- Terminate.cs
- DtrList.cs
- TextPatternIdentifiers.cs
- QueryRelOp.cs
- HwndHost.cs
- ImageCodecInfo.cs
- XmlSchemaRedefine.cs
- CmsInterop.cs
- DataGridViewRowConverter.cs
- GeneralTransform2DTo3DTo2D.cs
- PassportIdentity.cs
- Attributes.cs
- BindingMemberInfo.cs
- FlowDocumentView.cs
- BindingCompleteEventArgs.cs
- TextTreeFixupNode.cs
- ActivationProxy.cs
- ResourceKey.cs
- BaseCollection.cs
- BoolExpression.cs
- FunctionCommandText.cs
- RegistryKey.cs
- TextRangeBase.cs
- DnsPermission.cs
- InputScope.cs
- RSAOAEPKeyExchangeDeformatter.cs
- LoginView.cs
- XmlObjectSerializerReadContext.cs
- SessionStateItemCollection.cs
- XsltArgumentList.cs
- EmptyEnumerator.cs
- assemblycache.cs
- CryptographicAttribute.cs
- RadialGradientBrush.cs
- FixedSOMTableRow.cs
- CaseInsensitiveComparer.cs
- EventHandlerList.cs
- followingsibling.cs
- View.cs
- BounceEase.cs
- PropertyValidationContext.cs
- TextEffect.cs
- Msec.cs
- DetailsViewInsertEventArgs.cs
- LinkTarget.cs
- WorkflowExecutor.cs
- TrackingConditionCollection.cs
- Stack.cs
- EntityDataSourceState.cs
- WebConfigurationManager.cs
- SymLanguageType.cs
- StructuredTypeEmitter.cs
- nulltextnavigator.cs
- Repeater.cs
- Activity.cs
- CssTextWriter.cs
- VirtualPathProvider.cs
- precedingquery.cs
- DataGridBeginningEditEventArgs.cs
- CapabilitiesRule.cs
- TextContainerChangeEventArgs.cs
- ValueExpressions.cs
- ListViewSortEventArgs.cs
- Message.cs
- BitStack.cs
- NodeFunctions.cs
- PtsHelper.cs
- Margins.cs
- SignatureHelper.cs
- BitmapInitialize.cs