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
- APCustomTypeDescriptor.cs
- HtmlInputButton.cs
- DbConvert.cs
- SafeThreadHandle.cs
- Win32PrintDialog.cs
- UnsafeNativeMethodsCLR.cs
- DateTimeConverter2.cs
- SessionEndedEventArgs.cs
- ListItemDetailViewAttribute.cs
- HostingEnvironmentException.cs
- SecurityDocument.cs
- WorkerRequest.cs
- DataControlFieldCell.cs
- SpecularMaterial.cs
- WindowHideOrCloseTracker.cs
- ReferentialConstraint.cs
- IPGlobalProperties.cs
- JapaneseCalendar.cs
- SettingsProviderCollection.cs
- ProxyManager.cs
- FlowDocumentScrollViewer.cs
- InertiaRotationBehavior.cs
- ISFTagAndGuidCache.cs
- TableRowCollection.cs
- ReflectionPermission.cs
- CompiledRegexRunnerFactory.cs
- FigureParagraph.cs
- FullTrustAssembliesSection.cs
- RotationValidation.cs
- ComIntegrationManifestGenerator.cs
- OdbcConnectionHandle.cs
- MultilineStringConverter.cs
- TaiwanCalendar.cs
- MenuItemStyle.cs
- WebPartChrome.cs
- ListControlStringCollectionEditor.cs
- Common.cs
- MeasurementDCInfo.cs
- MouseEvent.cs
- DoubleLinkList.cs
- RangeContentEnumerator.cs
- PageVisual.cs
- PasswordBoxAutomationPeer.cs
- RolePrincipal.cs
- IndependentAnimationStorage.cs
- PerformanceCounterPermission.cs
- BinaryNode.cs
- CookieProtection.cs
- XmlAttribute.cs
- GPRECT.cs
- WizardForm.cs
- BulletedList.cs
- TextSerializer.cs
- SafeHandles.cs
- ProfileService.cs
- UriSection.cs
- UnmanagedMemoryStream.cs
- MatrixStack.cs
- SelectionItemPattern.cs
- MimeXmlImporter.cs
- ColorBlend.cs
- QilTypeChecker.cs
- unitconverter.cs
- DataGridCellInfo.cs
- HtmlLink.cs
- UserMapPath.cs
- DbMetaDataCollectionNames.cs
- ReversePositionQuery.cs
- TransactedBatchContext.cs
- UseLicense.cs
- GlyphRunDrawing.cs
- ListParagraph.cs
- EditCommandColumn.cs
- ProxyGenerator.cs
- EdmFunctionAttribute.cs
- AudienceUriMode.cs
- QilXmlWriter.cs
- GridViewUpdateEventArgs.cs
- ModelUtilities.cs
- CompilerCollection.cs
- AssemblyUtil.cs
- Selection.cs
- ReliableSessionBindingElement.cs
- HtmlHistory.cs
- FrameworkContextData.cs
- DefaultPropertyAttribute.cs
- SafeArrayTypeMismatchException.cs
- FrameworkContentElementAutomationPeer.cs
- CodeRegionDirective.cs
- MarkupCompilePass2.cs
- ThreadStateException.cs
- Pointer.cs
- ZipIOModeEnforcingStream.cs
- ResourcePart.cs
- SByte.cs
- XmlAnyElementAttribute.cs
- ServiceHostFactory.cs
- Vector3DConverter.cs
- DataSourceCacheDurationConverter.cs
- _IPv6Address.cs