Code:
/ Dotnetfx_Win7_3.5.1 / Dotnetfx_Win7_3.5.1 / 3.5.1 / DEVDIV / depot / DevDiv / releases / whidbey / NetFXspW7 / 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
- SymLanguageVendor.cs
- XmlStreamNodeWriter.cs
- PolyBezierSegment.cs
- TableRowCollection.cs
- GenericXmlSecurityTokenAuthenticator.cs
- MediaEntryAttribute.cs
- PageCatalogPart.cs
- BatchStream.cs
- MonthCalendar.cs
- SqlCrossApplyToCrossJoin.cs
- TransformProviderWrapper.cs
- MDIClient.cs
- WebServiceData.cs
- PeerInvitationResponse.cs
- SendingRequestEventArgs.cs
- UpdateCommand.cs
- InfoCardProofToken.cs
- ToolStripButton.cs
- XmlEncoding.cs
- SQLInt32.cs
- EastAsianLunisolarCalendar.cs
- NotConverter.cs
- PartialList.cs
- DataTableNewRowEvent.cs
- EffectiveValueEntry.cs
- PathFigure.cs
- DataGridViewCheckBoxCell.cs
- ExceptionValidationRule.cs
- BordersPage.cs
- XdrBuilder.cs
- RowUpdatedEventArgs.cs
- XmlTextAttribute.cs
- XmlReaderDelegator.cs
- StylusPointProperties.cs
- VisualStateChangedEventArgs.cs
- DbConnectionPoolIdentity.cs
- ResourceExpression.cs
- CorrelationTokenInvalidatedHandler.cs
- SessionState.cs
- BitmapEffectGroup.cs
- AvtEvent.cs
- AnnotationAuthorChangedEventArgs.cs
- QuaternionRotation3D.cs
- RestClientProxyHandler.cs
- ContentPlaceHolder.cs
- DiscoveryReference.cs
- SqlDataRecord.cs
- CounterSampleCalculator.cs
- Typeface.cs
- SafeUserTokenHandle.cs
- CodeDomDecompiler.cs
- SmtpDigestAuthenticationModule.cs
- ReferencedCollectionType.cs
- SimpleWorkerRequest.cs
- ObjectItemCollectionAssemblyCacheEntry.cs
- HwndPanningFeedback.cs
- MessageQueuePermissionAttribute.cs
- RangeValidator.cs
- AppDomainManager.cs
- ParagraphVisual.cs
- XmlRawWriter.cs
- NativeRecognizer.cs
- XmlTextAttribute.cs
- HttpModuleAction.cs
- Hashtable.cs
- DoubleStorage.cs
- EdgeProfileValidation.cs
- MulticastOption.cs
- COSERVERINFO.cs
- AQNBuilder.cs
- SupportsEventValidationAttribute.cs
- PathGeometry.cs
- DataSourceProvider.cs
- CodePropertyReferenceExpression.cs
- CodeSnippetTypeMember.cs
- SByte.cs
- FileDialog.cs
- DataGridViewColumnCollectionEditor.cs
- ColorPalette.cs
- Range.cs
- SQLGuidStorage.cs
- SigningCredentials.cs
- NamespaceCollection.cs
- WrappedOptions.cs
- DataViewManagerListItemTypeDescriptor.cs
- TraceContextEventArgs.cs
- TableCell.cs
- _Rfc2616CacheValidators.cs
- XPathMessageFilterElementComparer.cs
- SecurityContextKeyIdentifierClause.cs
- CheckBoxRenderer.cs
- ExpressionVisitorHelpers.cs
- DocumentViewer.cs
- DrawingAttributeSerializer.cs
- SQLInt32Storage.cs
- EraserBehavior.cs
- BezierSegment.cs
- BuildProviderUtils.cs
- RequiredArgumentAttribute.cs
- DoubleLink.cs