Code:
/ 4.0 / 4.0 / untmp / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / WinForms / Managed / System / WinForms / SpecialFolderEnumConverter.cs / 1305376 / 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.
Link Menu

This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- SafeEventLogWriteHandle.cs
- HandleCollector.cs
- HtmlShimManager.cs
- DockPanel.cs
- ActivityTypeResolver.xaml.cs
- LinkDescriptor.cs
- ContainerFilterService.cs
- CustomErrorCollection.cs
- RIPEMD160.cs
- InitializeCorrelation.cs
- SimpleFieldTemplateFactory.cs
- ExtractorMetadata.cs
- SoapWriter.cs
- UITypeEditor.cs
- MDIControlStrip.cs
- ConvertersCollection.cs
- TerminatorSinks.cs
- EndpointDiscoveryMetadata.cs
- XmlSchemaParticle.cs
- DrawTreeNodeEventArgs.cs
- CodeTypeMemberCollection.cs
- AspNetCompatibilityRequirementsMode.cs
- IntSecurity.cs
- HashHelper.cs
- DataMember.cs
- UdpDiscoveryEndpointElement.cs
- Freezable.cs
- ServerProtocol.cs
- DrawingVisualDrawingContext.cs
- PerfService.cs
- HierarchicalDataTemplate.cs
- ActionFrame.cs
- ClientScriptManager.cs
- remotingproxy.cs
- GenericUriParser.cs
- SqlFormatter.cs
- EventHandlers.cs
- XamlInt32CollectionSerializer.cs
- ProxyWebPartConnectionCollection.cs
- ACE.cs
- AdvancedBindingEditor.cs
- IdentityReference.cs
- TickBar.cs
- WindowsSpinner.cs
- FillErrorEventArgs.cs
- UIElementPropertyUndoUnit.cs
- PromptEventArgs.cs
- EventHandlersStore.cs
- InvariantComparer.cs
- TextModifierScope.cs
- XmlMembersMapping.cs
- AnnotationResource.cs
- MessageSecurityOverHttpElement.cs
- oledbmetadatacollectionnames.cs
- CustomExpressionEventArgs.cs
- ValidationResults.cs
- FormDesigner.cs
- CustomError.cs
- TextLine.cs
- BeginGetFileNameFromUserRequest.cs
- ObfuscationAttribute.cs
- RequestQueryProcessor.cs
- XmlNodeChangedEventArgs.cs
- SecurityRuntime.cs
- EventProxy.cs
- ReadOnlyDataSource.cs
- MenuAutomationPeer.cs
- SetterBaseCollection.cs
- StateWorkerRequest.cs
- SchemaMapping.cs
- DataGridViewLinkCell.cs
- SystemThemeKey.cs
- InvokeMethodDesigner.xaml.cs
- FloaterBaseParagraph.cs
- TreeNode.cs
- LocalizableResourceBuilder.cs
- DataList.cs
- HandlerWithFactory.cs
- UrlPath.cs
- DataError.cs
- WinEventQueueItem.cs
- ColorContext.cs
- TextTreeDeleteContentUndoUnit.cs
- MenuItemBinding.cs
- ScrollChangedEventArgs.cs
- WebBrowserDocumentCompletedEventHandler.cs
- UriParserTemplates.cs
- CancellationTokenSource.cs
- SerializationInfoEnumerator.cs
- ByteStreamBufferedMessageData.cs
- NumericUpDownAcceleration.cs
- XmlCDATASection.cs
- SqlServices.cs
- AdCreatedEventArgs.cs
- PeerToPeerException.cs
- ElementNotAvailableException.cs
- UserControlCodeDomTreeGenerator.cs
- _ProxyRegBlob.cs
- DataSourceControlBuilder.cs
- BypassElementCollection.cs