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
- FixedSOMPageConstructor.cs
- LayoutInformation.cs
- FlowDocument.cs
- TextOnlyOutput.cs
- X509Chain.cs
- DbParameterHelper.cs
- HtmlMeta.cs
- HttpCookie.cs
- PartitionResolver.cs
- DataBinding.cs
- CompositeCollectionView.cs
- IconHelper.cs
- Helpers.cs
- TraceUtils.cs
- AnonymousIdentificationModule.cs
- DynamicControl.cs
- TimeEnumHelper.cs
- DelayedRegex.cs
- HttpCacheVaryByContentEncodings.cs
- ServerValidateEventArgs.cs
- Transactions.cs
- XmlDataFileEditor.cs
- TypeBuilderInstantiation.cs
- BitmapEffectDrawingContextState.cs
- BypassElement.cs
- AutoResizedEvent.cs
- ToolboxItemAttribute.cs
- BooleanStorage.cs
- PagedDataSource.cs
- WpfWebRequestHelper.cs
- WaitForChangedResult.cs
- DataSourceCache.cs
- AttachedPropertyBrowsableForTypeAttribute.cs
- HttpRuntime.cs
- PnrpPermission.cs
- DbConnectionPoolOptions.cs
- SoapProtocolReflector.cs
- SyncMethodInvoker.cs
- HMACSHA256.cs
- DiagnosticsConfigurationHandler.cs
- ButtonBase.cs
- SecurityTokenRequirement.cs
- ProcessModule.cs
- SwitchElementsCollection.cs
- NonSerializedAttribute.cs
- CodeTypeReference.cs
- CustomAttributeBuilder.cs
- XmlTextReaderImplHelpers.cs
- TabItemAutomationPeer.cs
- Barrier.cs
- ListenUriMode.cs
- Win32PrintDialog.cs
- SqlUdtInfo.cs
- KnownTypesHelper.cs
- GeometryConverter.cs
- DataRelationCollection.cs
- ForceCopyBuildProvider.cs
- DrawingBrush.cs
- securestring.cs
- WebExceptionStatus.cs
- XmlSchemas.cs
- MessageBox.cs
- MobilePage.cs
- ValueType.cs
- GAC.cs
- Proxy.cs
- XamlPoint3DCollectionSerializer.cs
- TreeViewAutomationPeer.cs
- ModuleBuilderData.cs
- Brush.cs
- PolicyVersion.cs
- EdmSchemaError.cs
- WebPartDescriptionCollection.cs
- ExpressionBuilderContext.cs
- StorageComplexPropertyMapping.cs
- TreeNode.cs
- WebPartHeaderCloseVerb.cs
- ReversePositionQuery.cs
- HitTestFilterBehavior.cs
- SqlDataSourceCache.cs
- DbMetaDataFactory.cs
- RoutedUICommand.cs
- SaveFileDialogDesigner.cs
- ModelItemKeyValuePair.cs
- HostingPreferredMapPath.cs
- RangeValuePatternIdentifiers.cs
- CodeDOMUtility.cs
- IsolatedStorage.cs
- odbcmetadatacollectionnames.cs
- CLSCompliantAttribute.cs
- XmlParserContext.cs
- DelegateBodyWriter.cs
- FilePrompt.cs
- RelationshipConverter.cs
- TypeSemantics.cs
- AssemblyEvidenceFactory.cs
- SplashScreenNativeMethods.cs
- CompilerLocalReference.cs
- OleDbRowUpdatingEvent.cs
- QueryBranchOp.cs