Code:
/ FX-1434 / FX-1434 / 1.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
- BufferCache.cs
- MsmqAuthenticationMode.cs
- ToolBar.cs
- BooleanToVisibilityConverter.cs
- ClientConfigPaths.cs
- ContextMenu.cs
- HTMLTagNameToTypeMapper.cs
- SizeChangedInfo.cs
- DummyDataSource.cs
- XsltInput.cs
- OpenCollectionAsyncResult.cs
- OptimalBreakSession.cs
- GeneratedContractType.cs
- ProxyDataContractResolver.cs
- CompModSwitches.cs
- EntityContainerAssociationSet.cs
- CountAggregationOperator.cs
- ColorBuilder.cs
- XmlDigitalSignatureProcessor.cs
- HighlightOverlayGlyph.cs
- DataGridViewTopLeftHeaderCell.cs
- SafeLibraryHandle.cs
- ServiceSecurityAuditBehavior.cs
- DeleteStoreRequest.cs
- PointUtil.cs
- SiteMapNode.cs
- DataTablePropertyDescriptor.cs
- DisposableCollectionWrapper.cs
- ListBindingConverter.cs
- SmiContextFactory.cs
- EditingCommands.cs
- EntityCommand.cs
- ListViewItem.cs
- XMLSchema.cs
- RequestResizeEvent.cs
- BuildDependencySet.cs
- XpsS0ValidatingLoader.cs
- Codec.cs
- FlowDocumentView.cs
- DataQuery.cs
- RemoteWebConfigurationHostStream.cs
- ExpressionConverter.cs
- MimePart.cs
- WeakReference.cs
- SmtpMail.cs
- UrlMappingsSection.cs
- ValueUtilsSmi.cs
- ObjectParameterCollection.cs
- FileDataSourceCache.cs
- XmlSchemaElement.cs
- WindowsIPAddress.cs
- SafeNativeMethods.cs
- XmlMapping.cs
- Pkcs7Signer.cs
- TimelineCollection.cs
- EdmValidator.cs
- RsaSecurityKey.cs
- DynamicPropertyReader.cs
- IncrementalReadDecoders.cs
- ErrorFormatterPage.cs
- SizeChangedInfo.cs
- DbConnectionHelper.cs
- Publisher.cs
- ValuePatternIdentifiers.cs
- DocumentPageViewAutomationPeer.cs
- RelationshipNavigation.cs
- CodeParameterDeclarationExpression.cs
- Constants.cs
- GuidelineCollection.cs
- EntityObject.cs
- ManagedWndProcTracker.cs
- UIElementIsland.cs
- CatalogPart.cs
- FacetValues.cs
- FrameworkContentElement.cs
- SourceElementsCollection.cs
- AppliedDeviceFiltersDialog.cs
- TransformerConfigurationWizardBase.cs
- DecoderFallbackWithFailureFlag.cs
- ListContractAdapter.cs
- DataGridRow.cs
- TempFiles.cs
- GetIndexBinder.cs
- WebPartTracker.cs
- MessageDroppedTraceRecord.cs
- SafeWaitHandle.cs
- ListenerElementsCollection.cs
- SecurityKeyEntropyMode.cs
- ParseElement.cs
- DbConnectionStringCommon.cs
- ClientCultureInfo.cs
- ExportOptions.cs
- ColumnResult.cs
- EtwTrackingParticipant.cs
- ReadingWritingEntityEventArgs.cs
- XmlDataSource.cs
- ResourceSetExpression.cs
- SvcFileManager.cs
- Receive.cs
- InstanceData.cs