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
- RowsCopiedEventArgs.cs
- MailSettingsSection.cs
- DataGridViewColumn.cs
- MediaContext.cs
- AnimationClockResource.cs
- ExtensibleSyndicationObject.cs
- HtmlInputHidden.cs
- NativeMethodsCLR.cs
- DataServiceHost.cs
- DLinqDataModelProvider.cs
- wmiprovider.cs
- ResXFileRef.cs
- SafeBitVector32.cs
- RectAnimationClockResource.cs
- HtmlTableRowCollection.cs
- MenuBindingsEditorForm.cs
- SizeValueSerializer.cs
- ArglessEventHandlerProxy.cs
- XslTransform.cs
- IItemProperties.cs
- WebReferencesBuildProvider.cs
- ResizeGrip.cs
- DesignerSerializationOptionsAttribute.cs
- DataExpression.cs
- CurrentChangingEventManager.cs
- CodeTypeConstructor.cs
- _SslState.cs
- WebBaseEventKeyComparer.cs
- HtmlInputButton.cs
- RowToParametersTransformer.cs
- TextSelectionProcessor.cs
- Comparer.cs
- XmlKeywords.cs
- PointF.cs
- TextSelectionProcessor.cs
- UxThemeWrapper.cs
- ComponentManagerBroker.cs
- IconHelper.cs
- infer.cs
- BookmarkList.cs
- TableLayoutSettingsTypeConverter.cs
- IpcManager.cs
- Pkcs9Attribute.cs
- PatternMatcher.cs
- Connector.xaml.cs
- ExecutionScope.cs
- QueryExpression.cs
- LinqDataSourceView.cs
- AsnEncodedData.cs
- TextEditorSpelling.cs
- PostBackTrigger.cs
- HostingPreferredMapPath.cs
- KoreanCalendar.cs
- CannotUnloadAppDomainException.cs
- ElementNotAvailableException.cs
- TextElementCollection.cs
- Range.cs
- AppDomainAttributes.cs
- AuthenticatingEventArgs.cs
- WorkflowDesignerColors.cs
- EventHandlerList.cs
- MaskedTextBoxDesignerActionList.cs
- MailBnfHelper.cs
- Interlocked.cs
- BasicDesignerLoader.cs
- Tile.cs
- FragmentQuery.cs
- IntegerFacetDescriptionElement.cs
- NavigationCommands.cs
- DataListGeneralPage.cs
- ProfilePropertyNameValidator.cs
- QilFunction.cs
- AttributeProviderAttribute.cs
- ContentFileHelper.cs
- VisualTreeUtils.cs
- ExceptionValidationRule.cs
- HttpInputStream.cs
- Win32Exception.cs
- ListBoxAutomationPeer.cs
- RuntimeEnvironment.cs
- _RequestCacheProtocol.cs
- BitmapEffectInput.cs
- IncrementalReadDecoders.cs
- DependencyPropertyDescriptor.cs
- Encoder.cs
- wgx_commands.cs
- Point3DCollection.cs
- ImageField.cs
- ForEachAction.cs
- TransformerInfoCollection.cs
- WhitespaceSignificantCollectionAttribute.cs
- DataContract.cs
- CharacterShapingProperties.cs
- TypeUtils.cs
- TypeUsageBuilder.cs
- ClientRolePrincipal.cs
- DBSchemaRow.cs
- DataGridViewColumnDividerDoubleClickEventArgs.cs
- RoleGroupCollection.cs
- DataTableClearEvent.cs