Code:
/ Dotnetfx_Vista_SP2 / Dotnetfx_Vista_SP2 / 8.0.50727.4016 / DEVDIV / depot / DevDiv / releases / whidbey / NetFxQFE / ndp / fx / src / WinForms / Managed / System / WinForms / SpecialFolderEnumConverter.cs / 1 / SpecialFolderEnumConverter.cs
//------------------------------------------------------------------------------ //// Copyright (c) Microsoft Corporation. All rights reserved. // //----------------------------------------------------------------------------- namespace System.Windows.Forms { using System; using System.ComponentModel; using System.Collections; internal class SpecialFolderEnumConverter : AlphaSortedEnumConverter { public SpecialFolderEnumConverter(Type type) : base(type) { } ////// See VSWhidbey #376570. Personal appears twice in type editor because its numeric value matches with MyDocuments. /// This code filters out the duplicate value. public override StandardValuesCollection GetStandardValues(ITypeDescriptorContext context) { StandardValuesCollection values = base.GetStandardValues(context); ArrayList list = new ArrayList(); int count = values.Count; bool personalSeen = false; for (int i = 0; i < count; i++) { if (values[i] is System.Environment.SpecialFolder && values[i].Equals(System.Environment.SpecialFolder.Personal)) { if (!personalSeen) { personalSeen = true; list.Add(values[i]); } } else { list.Add(values[i]); } } return new StandardValuesCollection(list); } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. //------------------------------------------------------------------------------ // // Copyright (c) Microsoft Corporation. All rights reserved. // //----------------------------------------------------------------------------- namespace System.Windows.Forms { using System; using System.ComponentModel; using System.Collections; internal class SpecialFolderEnumConverter : AlphaSortedEnumConverter { public SpecialFolderEnumConverter(Type type) : base(type) { } ////// See VSWhidbey #376570. Personal appears twice in type editor because its numeric value matches with MyDocuments. /// This code filters out the duplicate value. public override StandardValuesCollection GetStandardValues(ITypeDescriptorContext context) { StandardValuesCollection values = base.GetStandardValues(context); ArrayList list = new ArrayList(); int count = values.Count; bool personalSeen = false; for (int i = 0; i < count; i++) { if (values[i] is System.Environment.SpecialFolder && values[i].Equals(System.Environment.SpecialFolder.Personal)) { if (!personalSeen) { personalSeen = true; list.Add(values[i]); } } else { list.Add(values[i]); } } return new StandardValuesCollection(list); } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007.
Link Menu

This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- ErasingStroke.cs
- prompt.cs
- ServiceNameCollection.cs
- _BasicClient.cs
- EncryptedData.cs
- InputManager.cs
- DataControlFieldCell.cs
- CodeAttributeArgument.cs
- HttpCachePolicy.cs
- PropertyTab.cs
- autovalidator.cs
- ExtensibleClassFactory.cs
- BamlTreeNode.cs
- Font.cs
- EllipticalNodeOperations.cs
- MessageAction.cs
- shaperfactoryquerycachekey.cs
- ServiceBuildProvider.cs
- CDSsyncETWBCLProvider.cs
- HMACSHA1.cs
- BooleanAnimationBase.cs
- Mapping.cs
- PhysicalFontFamily.cs
- SecurityTokenParametersEnumerable.cs
- DriveInfo.cs
- SiteIdentityPermission.cs
- ControlCollection.cs
- AdRotator.cs
- ProfileManager.cs
- Vector3DAnimationBase.cs
- UnsafeCollabNativeMethods.cs
- TextTreePropertyUndoUnit.cs
- GenerateScriptTypeAttribute.cs
- FontResourceCache.cs
- SharedStatics.cs
- RunInstallerAttribute.cs
- GC.cs
- ReliabilityContractAttribute.cs
- FileUtil.cs
- PrimitiveType.cs
- TraceContextRecord.cs
- ContextStaticAttribute.cs
- XmlDocumentSurrogate.cs
- ObjectCloneHelper.cs
- EncoderReplacementFallback.cs
- TemplateControlCodeDomTreeGenerator.cs
- glyphs.cs
- WindowHideOrCloseTracker.cs
- CodeIndexerExpression.cs
- QueueProcessor.cs
- SlipBehavior.cs
- TableAdapterManagerHelper.cs
- Switch.cs
- _DisconnectOverlappedAsyncResult.cs
- Scheduler.cs
- HttpFileCollectionBase.cs
- FirstMatchCodeGroup.cs
- SqlGenericUtil.cs
- CharacterHit.cs
- SubpageParaClient.cs
- ClientUriBehavior.cs
- TextEditorCopyPaste.cs
- XmlKeywords.cs
- UnsafeNativeMethods.cs
- ReverseComparer.cs
- DataGridViewRowEventArgs.cs
- FileDialogCustomPlace.cs
- BamlWriter.cs
- ColorPalette.cs
- IntegerFacetDescriptionElement.cs
- GrammarBuilderPhrase.cs
- EncoderReplacementFallback.cs
- FileNameEditor.cs
- CellParagraph.cs
- UInt16.cs
- VisualStyleInformation.cs
- TransformerTypeCollection.cs
- SQLSingleStorage.cs
- EventListener.cs
- Stylesheet.cs
- __ConsoleStream.cs
- EncryptedData.cs
- HttpHostedTransportConfiguration.cs
- ClientSponsor.cs
- ThreadPool.cs
- DataSourceHelper.cs
- SystemTcpConnection.cs
- SeekStoryboard.cs
- TransportContext.cs
- ExitEventArgs.cs
- LogReserveAndAppendState.cs
- ProfileManager.cs
- CaseInsensitiveHashCodeProvider.cs
- SchemaMerger.cs
- PageBuildProvider.cs
- TdsEnums.cs
- AssociationSet.cs
- SmtpNetworkElement.cs
- LineVisual.cs
- ValueOfAction.cs