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
- RichTextBoxConstants.cs
- PropertyIDSet.cs
- DriveInfo.cs
- AddInAttribute.cs
- ProbeMatchesMessage11.cs
- DbDeleteCommandTree.cs
- LogEntry.cs
- ListMarkerLine.cs
- DynamicDataRoute.cs
- DesignTimeData.cs
- BufferModeSettings.cs
- configsystem.cs
- Underline.cs
- VectorCollectionConverter.cs
- Win32SafeHandles.cs
- MetadataArtifactLoaderComposite.cs
- MediaSystem.cs
- XamlStream.cs
- DataGridViewComboBoxColumn.cs
- QuotedPrintableStream.cs
- TreeNode.cs
- XmlDeclaration.cs
- ViewStateModeByIdAttribute.cs
- DataSourceCollectionBase.cs
- FlowDocumentReaderAutomationPeer.cs
- RadioButtonAutomationPeer.cs
- CounterCreationData.cs
- SessionEndingEventArgs.cs
- HostProtectionException.cs
- TextBoxLine.cs
- Queue.cs
- Model3DGroup.cs
- HttpListenerContext.cs
- CaseInsensitiveOrdinalStringComparer.cs
- EntityDesignerBuildProvider.cs
- RequestValidator.cs
- MobileResource.cs
- AnnotationStore.cs
- _ConnectOverlappedAsyncResult.cs
- ForceCopyBuildProvider.cs
- DataGridRow.cs
- InvalidAsynchronousStateException.cs
- Part.cs
- XmlSerializerSection.cs
- ResourceReferenceExpression.cs
- WebPartHelpVerb.cs
- OledbConnectionStringbuilder.cs
- DesignerListAdapter.cs
- LocalizationComments.cs
- AutomationElement.cs
- DataSourceViewSchemaConverter.cs
- SqlPersonalizationProvider.cs
- XmlTextReaderImplHelpers.cs
- FtpCachePolicyElement.cs
- SerTrace.cs
- CodeGroup.cs
- TextPenaltyModule.cs
- Size.cs
- ProfileProvider.cs
- fixedPageContentExtractor.cs
- NestedContainer.cs
- SqlClientFactory.cs
- XmlReaderSettings.cs
- WinFormsComponentEditor.cs
- FirstQueryOperator.cs
- ConfigViewGenerator.cs
- PassportAuthentication.cs
- LocalizationComments.cs
- ManagedWndProcTracker.cs
- UInt16Converter.cs
- CorrelationManager.cs
- InputScope.cs
- SchemaMapping.cs
- UrlAuthFailedErrorFormatter.cs
- SafeNativeMethods.cs
- NumericExpr.cs
- UpdateTranslator.cs
- DirectionalLight.cs
- StoreContentChangedEventArgs.cs
- Utility.cs
- SqlClientPermission.cs
- StatusBar.cs
- ObjectViewListener.cs
- XmlSchemaAll.cs
- TableLayoutSettingsTypeConverter.cs
- MULTI_QI.cs
- CheckBoxList.cs
- DynamicEntity.cs
- XmlRawWriter.cs
- CollectionChange.cs
- ACE.cs
- SqlDataReaderSmi.cs
- VariableExpressionConverter.cs
- Color.cs
- DesignTimeTemplateParser.cs
- Emitter.cs
- Win32.cs
- XsltException.cs
- RenderTargetBitmap.cs
- URI.cs