Code:
/ FX-1434 / FX-1434 / 1.0 / untmp / whidbey / REDBITS / 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;
///
///
///
/// Provides a type converter to
/// convert ???? objects to and from various other representations.
///
///
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;
}
}
}
Link Menu

This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- XmlCountingReader.cs
- StateMachineAction.cs
- PolyQuadraticBezierSegmentFigureLogic.cs
- EntityContainerEmitter.cs
- IsolatedStorageSecurityState.cs
- ParameterCollectionEditorForm.cs
- XsltContext.cs
- ProviderException.cs
- ListControl.cs
- DLinqColumnProvider.cs
- OracleException.cs
- MethodExpression.cs
- TypeToken.cs
- ThicknessKeyFrameCollection.cs
- documentsequencetextcontainer.cs
- InternalConfigEventArgs.cs
- WebPartChrome.cs
- DbBuffer.cs
- HttpListenerResponse.cs
- ValueUtilsSmi.cs
- ApplicationException.cs
- AutoCompleteStringCollection.cs
- ObjectItemCollection.cs
- COM2Enum.cs
- RootProfilePropertySettingsCollection.cs
- MissingManifestResourceException.cs
- UIElement3D.cs
- Model3DGroup.cs
- HtmlWindowCollection.cs
- CharUnicodeInfo.cs
- OrderingInfo.cs
- PersonalizableAttribute.cs
- XsltContext.cs
- TextServicesProperty.cs
- ToolStripRenderEventArgs.cs
- ContextMenuStripGroup.cs
- OrthographicCamera.cs
- XmlNotation.cs
- XmlSchemaDocumentation.cs
- CheckBoxPopupAdapter.cs
- LinearGradientBrush.cs
- ProjectionPlan.cs
- DataReaderContainer.cs
- EntityContainerAssociationSet.cs
- IPipelineRuntime.cs
- XmlSchemaAttribute.cs
- SelectionPattern.cs
- TextContainerChangedEventArgs.cs
- ToolBar.cs
- URLIdentityPermission.cs
- DataGridViewAccessibleObject.cs
- JulianCalendar.cs
- ParserContext.cs
- RemoteX509AsymmetricSecurityKey.cs
- ellipse.cs
- QilStrConcatenator.cs
- XmlAttributes.cs
- ClrProviderManifest.cs
- OperandQuery.cs
- MessagingDescriptionAttribute.cs
- KeyValuePairs.cs
- Brush.cs
- TraceSource.cs
- DependencyObject.cs
- XmlSchemaObject.cs
- HierarchicalDataBoundControl.cs
- BindableTemplateBuilder.cs
- OdbcHandle.cs
- BuildManager.cs
- SqlBooleanMismatchVisitor.cs
- BinaryOperationBinder.cs
- NegotiationTokenAuthenticator.cs
- XMLSyntaxException.cs
- ResizeGrip.cs
- ConfigurationValues.cs
- XmlCustomFormatter.cs
- HtmlControlPersistable.cs
- TemplateField.cs
- HttpResponseHeader.cs
- Win32PrintDialog.cs
- RemoteWebConfigurationHostStream.cs
- SiteMapNodeItemEventArgs.cs
- ActivityExecutorDelegateInfo.cs
- IsolatedStoragePermission.cs
- ImportCatalogPart.cs
- DataObjectSettingDataEventArgs.cs
- ManagementNamedValueCollection.cs
- ToolStripContentPanelRenderEventArgs.cs
- GcSettings.cs
- VectorConverter.cs
- FocusWithinProperty.cs
- UrlParameterReader.cs
- SqlDataSourceFilteringEventArgs.cs
- TypeCacheManager.cs
- PartialToken.cs
- StringUtil.cs
- WebEventTraceProvider.cs
- TrustLevel.cs
- SiteMapPathDesigner.cs
- AuthorizationRule.cs