Code:
/ Dotnetfx_Vista_SP2 / Dotnetfx_Vista_SP2 / 8.0.50727.4016 / DEVDIV / depot / DevDiv / releases / whidbey / NetFxQFE / 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
- SchemaType.cs
- SmtpClient.cs
- HttpProcessUtility.cs
- NotifyIcon.cs
- CodeMethodInvokeExpression.cs
- Internal.cs
- HyperLinkDesigner.cs
- MailAddressCollection.cs
- DoWhile.cs
- FixedSOMPageConstructor.cs
- Base64Encoder.cs
- QuaternionRotation3D.cs
- RelationalExpressions.cs
- ConnectionInterfaceCollection.cs
- DrawingBrush.cs
- ObjectQueryProvider.cs
- ButtonChrome.cs
- FlowDocumentScrollViewer.cs
- XmlDesigner.cs
- PriorityItem.cs
- WebPartCancelEventArgs.cs
- LayoutSettings.cs
- DataGridRelationshipRow.cs
- SqlDataSourceSelectingEventArgs.cs
- LambdaCompiler.Generated.cs
- ReadOnlyDataSourceView.cs
- FormViewInsertedEventArgs.cs
- Transactions.cs
- ConfigUtil.cs
- DataObjectPastingEventArgs.cs
- ProvidePropertyAttribute.cs
- WebPartConnectionsCloseVerb.cs
- WeakRefEnumerator.cs
- GcSettings.cs
- MultiPropertyDescriptorGridEntry.cs
- OdbcDataReader.cs
- ConnectionStringSettingsCollection.cs
- CodeEntryPointMethod.cs
- LinearQuaternionKeyFrame.cs
- ServiceConfigurationTraceRecord.cs
- Vector3DCollection.cs
- XmlDictionary.cs
- SmtpNetworkElement.cs
- RowParagraph.cs
- CreateUserWizard.cs
- IResourceProvider.cs
- Debugger.cs
- HtmlDocument.cs
- ListViewDeleteEventArgs.cs
- BuildProviderAppliesToAttribute.cs
- TimelineGroup.cs
- DataSourceCache.cs
- DBSqlParserTableCollection.cs
- SqlEnums.cs
- SourceFileBuildProvider.cs
- DefaultBindingPropertyAttribute.cs
- Accessors.cs
- Int64Animation.cs
- Token.cs
- ProfileSettings.cs
- XmlSchemaAttribute.cs
- WebPart.cs
- XmlChoiceIdentifierAttribute.cs
- SearchForVirtualItemEventArgs.cs
- RoleServiceManager.cs
- Utils.cs
- FlatButtonAppearance.cs
- XamlFilter.cs
- VBIdentifierName.cs
- CultureTableRecord.cs
- PlainXmlWriter.cs
- ObjectDataSource.cs
- TransactionChannelFactory.cs
- IsolatedStoragePermission.cs
- DependencyProperty.cs
- IISMapPath.cs
- AspNetCompatibilityRequirementsMode.cs
- TargetPerspective.cs
- ArithmeticException.cs
- Enum.cs
- TrackingWorkflowEventArgs.cs
- SplineQuaternionKeyFrame.cs
- BasicHttpMessageSecurityElement.cs
- PropertySourceInfo.cs
- InkPresenterAutomationPeer.cs
- OrthographicCamera.cs
- XmlParser.cs
- StringValueSerializer.cs
- WindowAutomationPeer.cs
- ListBase.cs
- FixedTextBuilder.cs
- HostingEnvironmentWrapper.cs
- CharAnimationBase.cs
- WorkflowInstanceExtensionCollection.cs
- FlowchartStart.xaml.cs
- SecurityHelper.cs
- AbandonedMutexException.cs
- _HeaderInfoTable.cs
- ControlBuilderAttribute.cs
- MouseOverProperty.cs