Code:
/ Net / Net / 3.5.50727.3053 / DEVDIV / depot / DevDiv / releases / whidbey / netfxsp / 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
- SecurityDocument.cs
- ProxyFragment.cs
- ToolBar.cs
- SoapMessage.cs
- InputManager.cs
- XhtmlTextWriter.cs
- CircleHotSpot.cs
- PagedDataSource.cs
- XhtmlTextWriter.cs
- LogicalExpr.cs
- RecordConverter.cs
- TransportChannelListener.cs
- SmiXetterAccessMap.cs
- RightsManagementErrorHandler.cs
- Classification.cs
- BuildProviderUtils.cs
- RequestStatusBarUpdateEventArgs.cs
- SerialPinChanges.cs
- XComponentModel.cs
- ISAPIWorkerRequest.cs
- EditingCommands.cs
- ToolStripPanelCell.cs
- Rijndael.cs
- _DynamicWinsockMethods.cs
- AutoResetEvent.cs
- InvalidEnumArgumentException.cs
- EnterpriseServicesHelper.cs
- ThreadStartException.cs
- SystemIdentity.cs
- ListViewGroupConverter.cs
- IndexOutOfRangeException.cs
- DbInsertCommandTree.cs
- RuntimeResourceSet.cs
- ObjectItemCachedAssemblyLoader.cs
- LicFileLicenseProvider.cs
- SqlConnectionPoolProviderInfo.cs
- CodeParameterDeclarationExpressionCollection.cs
- Control.cs
- SqlInternalConnectionSmi.cs
- MonthChangedEventArgs.cs
- CodeObject.cs
- ActivitiesCollection.cs
- TitleStyle.cs
- SspiSafeHandles.cs
- DocumentViewerBase.cs
- OutputCacheProfile.cs
- KnownBoxes.cs
- OrderPreservingPipeliningSpoolingTask.cs
- HttpCapabilitiesBase.cs
- XmlSchemaGroupRef.cs
- JavaScriptString.cs
- ProfileInfo.cs
- TextTreeExtractElementUndoUnit.cs
- MetafileHeaderEmf.cs
- EventProvider.cs
- DifferencingCollection.cs
- EncoderParameters.cs
- HttpResponseInternalBase.cs
- BitmapEffectInputConnector.cs
- TraceInternal.cs
- SynchronizationLockException.cs
- SrgsText.cs
- IIS7UserPrincipal.cs
- BackgroundWorker.cs
- Color.cs
- RsaSecurityTokenAuthenticator.cs
- KeyboardInputProviderAcquireFocusEventArgs.cs
- TabPage.cs
- UnauthorizedAccessException.cs
- ListDictionaryInternal.cs
- ContextBase.cs
- SystemIPInterfaceStatistics.cs
- MexTcpBindingCollectionElement.cs
- ZipIOFileItemStream.cs
- StrongNameKeyPair.cs
- SurrogateSelector.cs
- StylusButton.cs
- FontStyles.cs
- Menu.cs
- EdgeModeValidation.cs
- RbTree.cs
- OutputScope.cs
- BrowserDefinition.cs
- WSSecurityOneDotOneReceiveSecurityHeader.cs
- MaterialCollection.cs
- PlaceHolder.cs
- ResourcePermissionBaseEntry.cs
- ComponentEditorForm.cs
- ChannelOptions.cs
- WindowsSolidBrush.cs
- BinaryMessageEncodingBindingElement.cs
- VoiceChangeEventArgs.cs
- ClientApiGenerator.cs
- IntegerValidatorAttribute.cs
- SqlColumnizer.cs
- SortQuery.cs
- SponsorHelper.cs
- Region.cs
- TextStore.cs
- TextProperties.cs