Code:
/ Net / Net / 3.5.50727.3053 / DEVDIV / depot / DevDiv / releases / whidbey / netfxsp / 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
- AsyncResult.cs
- Base64WriteStateInfo.cs
- TextRangeAdaptor.cs
- ComponentCollection.cs
- PersonalizableAttribute.cs
- Rect3DConverter.cs
- SelectingProviderEventArgs.cs
- XmlSchemaAnnotated.cs
- Label.cs
- NegotiateStream.cs
- QueryRelOp.cs
- OdbcReferenceCollection.cs
- GenerateHelper.cs
- CssClassPropertyAttribute.cs
- DesignerUtility.cs
- xamlnodes.cs
- StringBuilder.cs
- ProviderException.cs
- EntityDataSourceContainerNameConverter.cs
- MobileUserControl.cs
- BulletDecorator.cs
- EntityObject.cs
- XmlSchemaSet.cs
- InternalRelationshipCollection.cs
- Control.cs
- DateRangeEvent.cs
- PrivilegeNotHeldException.cs
- ItemsControlAutomationPeer.cs
- WindowHideOrCloseTracker.cs
- DefaultExpression.cs
- ReadOnlyDataSourceView.cs
- ArrayList.cs
- _UriTypeConverter.cs
- activationcontext.cs
- HtmlTable.cs
- ExceptionUtil.cs
- TextEditorSpelling.cs
- MexHttpBindingElement.cs
- SurrogateEncoder.cs
- SQLDecimal.cs
- ShaderEffect.cs
- CommunicationException.cs
- SmtpClient.cs
- LingerOption.cs
- PathFigureCollectionConverter.cs
- Or.cs
- ApplicationManager.cs
- DecimalAnimationUsingKeyFrames.cs
- ParserHooks.cs
- HtmlShim.cs
- EntityContainerRelationshipSetEnd.cs
- TreeNodeEventArgs.cs
- EmptyEnumerator.cs
- ProviderUtil.cs
- SqlDependencyListener.cs
- DataSourceViewSchemaConverter.cs
- XmlSchemaDatatype.cs
- SerializationUtilities.cs
- ConstructorNeedsTagAttribute.cs
- XmlSerializerVersionAttribute.cs
- SHA256Managed.cs
- ButtonField.cs
- HtmlTableRow.cs
- XPathNodeIterator.cs
- NameNode.cs
- SqlFunctionAttribute.cs
- FixedSchema.cs
- DirectoryNotFoundException.cs
- TriggerAction.cs
- DbBuffer.cs
- ColorBlend.cs
- DetailsViewUpdatedEventArgs.cs
- JsonQNameDataContract.cs
- DataSvcMapFileSerializer.cs
- ClientProxyGenerator.cs
- RectKeyFrameCollection.cs
- ImportContext.cs
- DoubleSumAggregationOperator.cs
- InheritanceAttribute.cs
- SqlEnums.cs
- TreeNodeCollection.cs
- SourceLineInfo.cs
- XmlSchemaObjectTable.cs
- DynamicScriptObject.cs
- HtmlTernaryTree.cs
- HttpListenerResponse.cs
- InternalControlCollection.cs
- Blend.cs
- NameScope.cs
- DataGridLength.cs
- HttpModuleCollection.cs
- StrokeDescriptor.cs
- Dictionary.cs
- SerializeAbsoluteContext.cs
- GenerateTemporaryTargetAssembly.cs
- codemethodreferenceexpression.cs
- Rijndael.cs
- AttributedMetaModel.cs
- GcHandle.cs
- EntityContainerEmitter.cs