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
- StorageMappingItemLoader.cs
- Int32.cs
- WebPartEditorApplyVerb.cs
- SQLBoolean.cs
- PeerNameRecord.cs
- nulltextcontainer.cs
- ProfileService.cs
- DesignerDataTable.cs
- XmlSchemaNotation.cs
- HtmlInputCheckBox.cs
- NetworkInformationException.cs
- SponsorHelper.cs
- DbException.cs
- SqlRowUpdatedEvent.cs
- ContainerUtilities.cs
- TextWriterTraceListener.cs
- XmlILModule.cs
- PropertyConverter.cs
- MessageParameterAttribute.cs
- SimpleHandlerFactory.cs
- OutputCacheSettings.cs
- XPathBinder.cs
- PlacementWorkspace.cs
- ToolStripSeparatorRenderEventArgs.cs
- TypeSource.cs
- ScrollEventArgs.cs
- MaskDescriptor.cs
- RootNamespaceAttribute.cs
- XslAstAnalyzer.cs
- WebServiceParameterData.cs
- RegionInfo.cs
- documentation.cs
- KnownBoxes.cs
- StringExpressionSet.cs
- MarshalByValueComponent.cs
- FixedTextSelectionProcessor.cs
- BamlTreeMap.cs
- SignerInfo.cs
- LeafCellTreeNode.cs
- QueryStringParameter.cs
- IOException.cs
- TimeoutException.cs
- PageBreakRecord.cs
- LockedActivityGlyph.cs
- WS2007FederationHttpBindingCollectionElement.cs
- Triplet.cs
- DependencyPropertyConverter.cs
- Rect3DValueSerializer.cs
- DbProviderManifest.cs
- ObjectDisposedException.cs
- ExpressionEditorAttribute.cs
- BindStream.cs
- SponsorHelper.cs
- documentation.cs
- QueryBranchOp.cs
- InfoCard.cs
- IPEndPoint.cs
- OperationInvokerBehavior.cs
- QilExpression.cs
- CacheSection.cs
- StreamingContext.cs
- Configuration.cs
- InvalidCommandTreeException.cs
- XPathItem.cs
- RecognizedPhrase.cs
- GraphicsContainer.cs
- MDIClient.cs
- CultureTableRecord.cs
- AlignmentXValidation.cs
- XmlILConstructAnalyzer.cs
- TypedElement.cs
- MeasurementDCInfo.cs
- MultiAsyncResult.cs
- DemultiplexingClientMessageFormatter.cs
- DispatcherTimer.cs
- FileDialog_Vista.cs
- WorkflowOperationFault.cs
- DateTime.cs
- StrongTypingException.cs
- SinglePageViewer.cs
- AsymmetricSignatureDeformatter.cs
- NativeMethods.cs
- FusionWrap.cs
- Currency.cs
- TableDetailsCollection.cs
- XmlDataSource.cs
- List.cs
- MappableObjectManager.cs
- Viewport3DAutomationPeer.cs
- UnhandledExceptionEventArgs.cs
- PropertyExpression.cs
- WindowsFormsLinkLabel.cs
- backend.cs
- Geometry3D.cs
- Formatter.cs
- WebEventTraceProvider.cs
- ContextProperty.cs
- ClientBuildManager.cs
- TiffBitmapEncoder.cs
- PageClientProxyGenerator.cs