Code:
/ DotNET / DotNET / 8.0 / untmp / whidbey / REDBITS / 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.
Link Menu

This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- PrintingPermissionAttribute.cs
- XmlCharCheckingReader.cs
- DeleteIndexBinder.cs
- ContentControl.cs
- SingleStorage.cs
- DrawingCollection.cs
- CalendarAutoFormatDialog.cs
- ConfigurationStrings.cs
- DirectoryInfo.cs
- baseaxisquery.cs
- Publisher.cs
- KeyTime.cs
- MenuItemStyle.cs
- HTMLTextWriter.cs
- HttpCookie.cs
- ScopedKnownTypes.cs
- ComponentCodeDomSerializer.cs
- WebPartTransformerCollection.cs
- EntityDescriptor.cs
- AddIn.cs
- CustomAttributeSerializer.cs
- InstanceDataCollectionCollection.cs
- Comparer.cs
- GenericEnumerator.cs
- RelatedView.cs
- InternalBufferManager.cs
- Visual3D.cs
- SizeChangedEventArgs.cs
- DeploymentSectionCache.cs
- AssociatedControlConverter.cs
- TreeViewTemplateSelector.cs
- AnnotationComponentChooser.cs
- CheckBoxRenderer.cs
- HtmlInputFile.cs
- VisualState.cs
- WebHeaderCollection.cs
- UserMapPath.cs
- OrthographicCamera.cs
- EventLogTraceListener.cs
- WorkerRequest.cs
- AssemblyInfo.cs
- DesignerCategoryAttribute.cs
- TraceXPathNavigator.cs
- SafeArrayRankMismatchException.cs
- Stackframe.cs
- Deflater.cs
- ThreadStaticAttribute.cs
- DependencyProperty.cs
- DocumentViewerBaseAutomationPeer.cs
- CookieProtection.cs
- CodeTypeMember.cs
- FacetDescriptionElement.cs
- RoutedEventValueSerializer.cs
- DataGridViewCellFormattingEventArgs.cs
- AspProxy.cs
- MSG.cs
- DesignerMetadata.cs
- PackageRelationship.cs
- MediaScriptCommandRoutedEventArgs.cs
- ErrorHandler.cs
- _NtlmClient.cs
- XslNumber.cs
- EncryptedType.cs
- designeractionbehavior.cs
- UTF7Encoding.cs
- DataStorage.cs
- XmlObjectSerializerReadContextComplex.cs
- CardSpaceSelector.cs
- ObjectStateEntryBaseUpdatableDataRecord.cs
- NamespaceInfo.cs
- PtsHost.cs
- MessagePropertyFilter.cs
- DBConcurrencyException.cs
- DSACryptoServiceProvider.cs
- HttpModuleCollection.cs
- SvcMapFileLoader.cs
- SortedDictionary.cs
- SRGSCompiler.cs
- DetailsViewInsertedEventArgs.cs
- SerialReceived.cs
- GridErrorDlg.cs
- MiniAssembly.cs
- XamlBrushSerializer.cs
- ComponentCodeDomSerializer.cs
- TreePrinter.cs
- ZoneLinkButton.cs
- MobileUserControlDesigner.cs
- ToolStripDesignerAvailabilityAttribute.cs
- ScrollData.cs
- FixedSOMPage.cs
- Underline.cs
- TypeToArgumentTypeConverter.cs
- PageStatePersister.cs
- MarginsConverter.cs
- XmlQueryRuntime.cs
- _OSSOCK.cs
- TreeNodeMouseHoverEvent.cs
- XmlSchemaRedefine.cs
- Stack.cs
- dtdvalidator.cs