Code:
/ Dotnetfx_Win7_3.5.1 / Dotnetfx_Win7_3.5.1 / 3.5.1 / DEVDIV / depot / DevDiv / releases / whidbey / NetFXspW7 / 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
- SqlRecordBuffer.cs
- SystemIcmpV6Statistics.cs
- UnknownBitmapDecoder.cs
- BaseTemplateBuildProvider.cs
- TemplateBaseAction.cs
- XPathSingletonIterator.cs
- BaseComponentEditor.cs
- WebBrowserContainer.cs
- XmlEnumAttribute.cs
- listitem.cs
- mediaeventargs.cs
- KnownIds.cs
- ProfileSettings.cs
- ArgIterator.cs
- QilPatternFactory.cs
- SessionStateUtil.cs
- UInt16Converter.cs
- IndexedSelectQueryOperator.cs
- AssemblyHash.cs
- FlowLayoutSettings.cs
- PointConverter.cs
- ServicePoint.cs
- AddInAttribute.cs
- MimeImporter.cs
- FontDifferentiator.cs
- PageContentCollection.cs
- PropertyRef.cs
- Vector.cs
- FixUpCollection.cs
- ByteStorage.cs
- TextBox.cs
- ReceiveActivity.cs
- StateManagedCollection.cs
- SchemaTypeEmitter.cs
- VisualTarget.cs
- CompiledAction.cs
- adornercollection.cs
- SizeF.cs
- HttpCacheVary.cs
- CacheRequest.cs
- Registry.cs
- ArithmeticException.cs
- NamedPipeChannelListener.cs
- ObjectAssociationEndMapping.cs
- UpDownEvent.cs
- PermissionSet.cs
- GridViewRowCollection.cs
- MailMessageEventArgs.cs
- StrongName.cs
- VarInfo.cs
- ThreadPoolTaskScheduler.cs
- Button.cs
- CodeNamespaceImportCollection.cs
- AddressingVersion.cs
- OdbcPermission.cs
- StylusPointDescription.cs
- MsmqHostedTransportManager.cs
- ComboBoxAutomationPeer.cs
- RootBuilder.cs
- ArrayElementGridEntry.cs
- HttpServerProtocol.cs
- XamlReaderHelper.cs
- SerializableAttribute.cs
- counter.cs
- DataGridItemAutomationPeer.cs
- SourceFilter.cs
- EmptyTextWriter.cs
- SystemColorTracker.cs
- RandomNumberGenerator.cs
- TemplateControl.cs
- DesignerAutoFormat.cs
- AutomationIdentifierGuids.cs
- WorkflowViewService.cs
- DataGridViewTopLeftHeaderCell.cs
- InstanceHandleConflictException.cs
- ConnectionInterfaceCollection.cs
- RegionIterator.cs
- PropertyGridCommands.cs
- SqlAggregateChecker.cs
- OdbcConnectionPoolProviderInfo.cs
- BitmapCacheBrush.cs
- DefaultMemberAttribute.cs
- DbProviderFactoriesConfigurationHandler.cs
- DeploymentSectionCache.cs
- ExtensionElementCollection.cs
- SchemaAttDef.cs
- MetadataHelper.cs
- XmlSchemaComplexContentRestriction.cs
- BitmapEffectInputData.cs
- HttpCacheVaryByContentEncodings.cs
- CriticalFinalizerObject.cs
- WebPartZoneCollection.cs
- DocumentApplicationJournalEntry.cs
- MessageAction.cs
- IntegerFacetDescriptionElement.cs
- MethodBody.cs
- WindowsTokenRoleProvider.cs
- DragStartedEventArgs.cs
- GradientStop.cs
- NativeRecognizer.cs