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
- ChangeDirector.cs
- TextTreeExtractElementUndoUnit.cs
- BaseTemplateCodeDomTreeGenerator.cs
- SyndicationItem.cs
- SerializationStore.cs
- DisplayMemberTemplateSelector.cs
- ParamArrayAttribute.cs
- DeflateStream.cs
- CachedBitmap.cs
- ThicknessAnimationBase.cs
- NeutralResourcesLanguageAttribute.cs
- SimpleTypeResolver.cs
- DeobfuscatingStream.cs
- ToolboxComponentsCreatingEventArgs.cs
- compensatingcollection.cs
- SystemDiagnosticsSection.cs
- ConfigUtil.cs
- DictionaryMarkupSerializer.cs
- PerformanceCountersElement.cs
- MutableAssemblyCacheEntry.cs
- CustomError.cs
- PeerNameResolver.cs
- HttpResponseBase.cs
- NativeObjectSecurity.cs
- ClientBuildManagerCallback.cs
- ChannelTracker.cs
- XmlLanguageConverter.cs
- PerformanceCounterPermission.cs
- HostedHttpRequestAsyncResult.cs
- SerializationInfo.cs
- WebExceptionStatus.cs
- UITypeEditors.cs
- HttpWebRequest.cs
- MemoryRecordBuffer.cs
- _LocalDataStore.cs
- ProgramPublisher.cs
- CommandConverter.cs
- MultiTrigger.cs
- AutomationProperties.cs
- BrowserDefinitionCollection.cs
- HwndHostAutomationPeer.cs
- ISAPIRuntime.cs
- VolatileEnlistmentMultiplexing.cs
- CounterCreationDataCollection.cs
- DesignerActionGlyph.cs
- Scheduler.cs
- ErrorTableItemStyle.cs
- MethodRental.cs
- ImageAutomationPeer.cs
- StorageTypeMapping.cs
- PropertyStore.cs
- DocumentApplicationJournalEntry.cs
- PerfCounterSection.cs
- PriorityChain.cs
- ArgIterator.cs
- DiscoveryMessageSequence.cs
- UndoEngine.cs
- MenuAutomationPeer.cs
- XmlTypeAttribute.cs
- Rules.cs
- MetadataSource.cs
- CompareValidator.cs
- ThrowHelper.cs
- EdmSchemaAttribute.cs
- DBCommandBuilder.cs
- Error.cs
- Matrix3DValueSerializer.cs
- SqlNodeAnnotations.cs
- xml.cs
- ReflectTypeDescriptionProvider.cs
- EventWaitHandle.cs
- HtmlInputSubmit.cs
- ConfigurationManagerInternal.cs
- SimpleFileLog.cs
- XmlIgnoreAttribute.cs
- TranslateTransform.cs
- RotateTransform3D.cs
- SecuritySessionFilter.cs
- SqlPersonalizationProvider.cs
- Assembly.cs
- PolyBezierSegmentFigureLogic.cs
- WebPartTracker.cs
- SignedXml.cs
- ToggleProviderWrapper.cs
- DataGridTableCollection.cs
- CacheSection.cs
- FontStyle.cs
- FileDialog_Vista.cs
- PassportPrincipal.cs
- XmlSchemaExternal.cs
- UntypedNullExpression.cs
- indexingfiltermarshaler.cs
- DataRowComparer.cs
- SQLBinary.cs
- Vector3DAnimationUsingKeyFrames.cs
- PictureBox.cs
- AppSettingsReader.cs
- CustomErrorsSection.cs
- ListenerServiceInstallComponent.cs
- SQLDecimal.cs