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
- DataGridItemCollection.cs
- PathFigure.cs
- AddIn.cs
- UnicodeEncoding.cs
- LinkConverter.cs
- RequestUriProcessor.cs
- ListViewItem.cs
- Parameter.cs
- BoolLiteral.cs
- ConsoleTraceListener.cs
- WebPartHeaderCloseVerb.cs
- RoutingTable.cs
- ColumnBinding.cs
- OdbcUtils.cs
- BufferBuilder.cs
- ReturnEventArgs.cs
- InteropTrackingRecord.cs
- DataGridViewColumnCollection.cs
- GridViewColumnCollectionChangedEventArgs.cs
- DataViewSettingCollection.cs
- SoapHttpTransportImporter.cs
- ListItemConverter.cs
- DirectionalLight.cs
- ScriptingAuthenticationServiceSection.cs
- HttpResponseWrapper.cs
- ExpandCollapseProviderWrapper.cs
- DesignerResources.cs
- StreamDocument.cs
- MediaPlayerState.cs
- FieldNameLookup.cs
- SqlRecordBuffer.cs
- MatrixTransform.cs
- AnimationException.cs
- SafeArchiveContext.cs
- SafeNativeMethods.cs
- QilPatternVisitor.cs
- DCSafeHandle.cs
- MemoryStream.cs
- QueryContinueDragEvent.cs
- mactripleDES.cs
- IProvider.cs
- BamlCollectionHolder.cs
- SHA512Managed.cs
- TypeConverterBase.cs
- COM2ExtendedTypeConverter.cs
- BasicKeyConstraint.cs
- AutomationPropertyChangedEventArgs.cs
- AdCreatedEventArgs.cs
- Dump.cs
- EditorOptionAttribute.cs
- ApplicationSecurityInfo.cs
- VScrollProperties.cs
- BooleanFunctions.cs
- DataTableMappingCollection.cs
- WebPartTransformer.cs
- PropertyEntry.cs
- OutOfProcStateClientManager.cs
- NullableBoolConverter.cs
- ArraySubsetEnumerator.cs
- ConfigsHelper.cs
- BehaviorEditorPart.cs
- MetaModel.cs
- CollaborationHelperFunctions.cs
- NegotiateStream.cs
- ValueTable.cs
- KnownTypesHelper.cs
- XamlDesignerSerializationManager.cs
- PrintPageEvent.cs
- Internal.cs
- WindowsNonControl.cs
- MissingMethodException.cs
- KoreanLunisolarCalendar.cs
- DataGridColumn.cs
- DataGrid.cs
- FileVersionInfo.cs
- DocumentSequence.cs
- UInt16Storage.cs
- CodeRegionDirective.cs
- CompoundFileReference.cs
- SerializationException.cs
- EventLogPermissionEntry.cs
- SID.cs
- MasterPage.cs
- SpeechRecognitionEngine.cs
- TimeSpanMinutesOrInfiniteConverter.cs
- DeploymentSectionCache.cs
- TreeView.cs
- SqlDelegatedTransaction.cs
- SqlHelper.cs
- DocumentPage.cs
- DoubleLink.cs
- IfJoinedCondition.cs
- SourceSwitch.cs
- Int64Converter.cs
- PathGradientBrush.cs
- DataPagerCommandEventArgs.cs
- ConfigurationCollectionAttribute.cs
- TrustManagerPromptUI.cs
- TreeViewCancelEvent.cs
- WebPartManagerInternals.cs