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
- SoundPlayer.cs
- SafeTimerHandle.cs
- ChangeDirector.cs
- QueueException.cs
- Crc32Helper.cs
- SmiMetaDataProperty.cs
- SafeCryptContextHandle.cs
- DataSourceSelectArguments.cs
- Reference.cs
- AnonymousIdentificationSection.cs
- RawStylusInputCustomData.cs
- ViewGenResults.cs
- OracleCommand.cs
- PointConverter.cs
- DataGridColumn.cs
- DEREncoding.cs
- SimpleMailWebEventProvider.cs
- GridViewSortEventArgs.cs
- Automation.cs
- SettingsPropertyCollection.cs
- FixedSOMTable.cs
- ResolveDuplexAsyncResult.cs
- SiteMapNodeItem.cs
- AsymmetricSignatureFormatter.cs
- ApplicationCommands.cs
- Completion.cs
- Site.cs
- PropertyDescriptor.cs
- XpsDocumentEvent.cs
- ElementProxy.cs
- PackageFilter.cs
- SqlDependencyUtils.cs
- XmlTextReaderImpl.cs
- DataSpaceManager.cs
- SizeLimitedCache.cs
- DelegatedStream.cs
- BindingManagerDataErrorEventArgs.cs
- FormViewPagerRow.cs
- QueueAccessMode.cs
- DataTableMappingCollection.cs
- SplitterEvent.cs
- SettingsPropertyNotFoundException.cs
- TextDecorationCollection.cs
- categoryentry.cs
- XamlToRtfWriter.cs
- UInt64.cs
- AttributeUsageAttribute.cs
- DPAPIProtectedConfigurationProvider.cs
- ScriptManagerProxy.cs
- WindowsTooltip.cs
- WindowsContainer.cs
- RootProfilePropertySettingsCollection.cs
- DesignerSerializationOptionsAttribute.cs
- XmlSchemaAttributeGroupRef.cs
- AssociationEndMember.cs
- SequentialUshortCollection.cs
- SqlDataSourceConfigureFilterForm.cs
- LocalValueEnumerator.cs
- StringComparer.cs
- XmlSerializationGeneratedCode.cs
- GB18030Encoding.cs
- SettingsBase.cs
- FreezableCollection.cs
- DesignerActionService.cs
- BitmapSource.cs
- StringComparer.cs
- ApplicationFileCodeDomTreeGenerator.cs
- WaitHandleCannotBeOpenedException.cs
- LinqDataSourceValidationException.cs
- StrongNameHelpers.cs
- AudioBase.cs
- DataListCommandEventArgs.cs
- Brush.cs
- TextRangeProviderWrapper.cs
- DataControlCommands.cs
- ListViewCommandEventArgs.cs
- ZoneMembershipCondition.cs
- RSAOAEPKeyExchangeFormatter.cs
- OAVariantLib.cs
- Codec.cs
- DataGrid.cs
- WindowsContainer.cs
- QueryResponse.cs
- remotingproxy.cs
- ControlLocalizer.cs
- HorizontalAlignConverter.cs
- WizardPanel.cs
- AspProxy.cs
- TemplateXamlTreeBuilder.cs
- PathGeometry.cs
- TabControlAutomationPeer.cs
- CompilerErrorCollection.cs
- ActivityCodeGenerator.cs
- SoapEnumAttribute.cs
- TaskFormBase.cs
- Thumb.cs
- PropertyFilterAttribute.cs
- DefaultValueTypeConverter.cs
- ThicknessConverter.cs
- Base64Encoder.cs