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
- TripleDES.cs
- ServiceModelConfigurationElementCollection.cs
- DefaultHttpHandler.cs
- LexicalChunk.cs
- XamlPoint3DCollectionSerializer.cs
- FlowSwitchLink.cs
- SqlDuplicator.cs
- StackBuilderSink.cs
- XsltInput.cs
- SiteMembershipCondition.cs
- OleTxTransaction.cs
- SByteConverter.cs
- Nullable.cs
- WindowsClaimSet.cs
- CodeCatchClauseCollection.cs
- SQLInt64.cs
- ImageListImage.cs
- _NegoState.cs
- IntSecurity.cs
- ProcessDesigner.cs
- TextAutomationPeer.cs
- BindingList.cs
- WindowsContainer.cs
- ProcessRequestAsyncResult.cs
- Point3DCollection.cs
- OneOf.cs
- DataGridState.cs
- SoapServerProtocol.cs
- Number.cs
- ProgressBarBrushConverter.cs
- OleDbStruct.cs
- FileSecurity.cs
- GcHandle.cs
- SimpleHandlerBuildProvider.cs
- InfiniteIntConverter.cs
- XmlEventCache.cs
- BezierSegment.cs
- ConsoleEntryPoint.cs
- ConfigurationSectionCollection.cs
- UTF7Encoding.cs
- SortedList.cs
- ResXBuildProvider.cs
- SAPICategories.cs
- SeverityFilter.cs
- DecodeHelper.cs
- AttributeCollection.cs
- LassoSelectionBehavior.cs
- CardSpaceShim.cs
- HostingPreferredMapPath.cs
- UnmanagedMemoryStreamWrapper.cs
- List.cs
- DataObjectPastingEventArgs.cs
- MarshalByRefObject.cs
- RequestUriProcessor.cs
- TypeConverterMarkupExtension.cs
- TypeToken.cs
- SymbolTable.cs
- ReadonlyMessageFilter.cs
- UInt16Converter.cs
- WebPartConnectionsEventArgs.cs
- SqlDataSourceQuery.cs
- WpfWebRequestHelper.cs
- XMLUtil.cs
- storepermission.cs
- Match.cs
- ReliabilityContractAttribute.cs
- HttpsTransportBindingElement.cs
- EncodingNLS.cs
- MessageEnumerator.cs
- FlatButtonAppearance.cs
- NumberFormatInfo.cs
- CultureTable.cs
- CompilerScopeManager.cs
- TimeSpanStorage.cs
- ImpersonationOption.cs
- MetadataArtifactLoaderComposite.cs
- WindowsRebar.cs
- XmlSchemaGroup.cs
- IpcChannel.cs
- SafeArrayTypeMismatchException.cs
- SQLUtility.cs
- Int16.cs
- SchemaElementDecl.cs
- XslCompiledTransform.cs
- DataExpression.cs
- BindingObserver.cs
- FlagPanel.cs
- pingexception.cs
- SudsParser.cs
- Quad.cs
- AssociationSetMetadata.cs
- DataGridViewButtonColumn.cs
- ErrorProvider.cs
- DBDataPermission.cs
- PackageRelationship.cs
- XNameTypeConverter.cs
- EntryIndex.cs
- StandardCommands.cs
- ResourceDisplayNameAttribute.cs
- RichTextBoxConstants.cs