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
- IntAverageAggregationOperator.cs
- MissingMethodException.cs
- LineSegment.cs
- DbProviderFactory.cs
- FileAuthorizationModule.cs
- DispatcherEventArgs.cs
- httpserverutility.cs
- StatusInfoItem.cs
- ToolBarTray.cs
- UserCancellationException.cs
- TriggerAction.cs
- SpeechRecognizer.cs
- RectangleGeometry.cs
- ApplicationServicesHostFactory.cs
- OrderedHashRepartitionStream.cs
- CookieProtection.cs
- CustomMenuItemCollection.cs
- FactoryMaker.cs
- SerializationInfo.cs
- SystemTcpConnection.cs
- CustomAttributeFormatException.cs
- Accessible.cs
- FixedSchema.cs
- BufferedStream.cs
- IntSecurity.cs
- ResourceExpression.cs
- ImageFormat.cs
- DynamicValidatorEventArgs.cs
- FileChangesMonitor.cs
- Double.cs
- PageStatePersister.cs
- ProfessionalColorTable.cs
- Matrix3DStack.cs
- CompletedAsyncResult.cs
- RequestBringIntoViewEventArgs.cs
- DataGridViewImageCell.cs
- ProfilePropertyMetadata.cs
- XPathPatternParser.cs
- GenerateScriptTypeAttribute.cs
- UIElementParagraph.cs
- RegexCode.cs
- DeclarativeExpressionConditionDeclaration.cs
- PopupRoot.cs
- RectAnimation.cs
- SequentialOutput.cs
- cookie.cs
- WinFormsUtils.cs
- SafeLocalMemHandle.cs
- TCPClient.cs
- ConfigurationStrings.cs
- ResourceWriter.cs
- NoneExcludedImageIndexConverter.cs
- DocobjHost.cs
- AdRotator.cs
- QueryLifecycle.cs
- InstalledFontCollection.cs
- DecoderFallbackWithFailureFlag.cs
- ProfileModule.cs
- BufferModeSettings.cs
- CompoundFileStreamReference.cs
- TraceFilter.cs
- ButtonBase.cs
- FlowDocumentReader.cs
- WindowsStartMenu.cs
- ClientRolePrincipal.cs
- OpenFileDialog.cs
- MetadataExchangeBindings.cs
- AttributeAction.cs
- BoundField.cs
- TimeoutValidationAttribute.cs
- RelationshipDetailsCollection.cs
- BindingObserver.cs
- HtmlTableCellCollection.cs
- translator.cs
- VScrollBar.cs
- TextServicesCompartmentContext.cs
- TextTreeUndoUnit.cs
- StringConcat.cs
- ObjectListGeneralPage.cs
- XmlLangPropertyAttribute.cs
- StaticExtension.cs
- WsdlHelpGeneratorElement.cs
- CompositeTypefaceMetrics.cs
- SiteMembershipCondition.cs
- OutputCacheModule.cs
- DrawingAttributes.cs
- HtmlLiteralTextAdapter.cs
- BrowserCapabilitiesFactory35.cs
- DataColumnChangeEvent.cs
- MenuEventArgs.cs
- Int32Converter.cs
- AttachedPropertyBrowsableForChildrenAttribute.cs
- DataBindingExpressionBuilder.cs
- OutputCacheSection.cs
- AdRotatorDesigner.cs
- LostFocusEventManager.cs
- ScrollChrome.cs
- TabRenderer.cs
- ETagAttribute.cs
- InvokeGenerator.cs