Code:
/ DotNET / DotNET / 8.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
- RelationshipConstraintValidator.cs
- RelationshipManager.cs
- MenuCommandService.cs
- HttpFormatExtensions.cs
- CqlLexerHelpers.cs
- PrinterUnitConvert.cs
- EntitySqlQueryState.cs
- ISO2022Encoding.cs
- MessageQueuePermissionEntryCollection.cs
- _SpnDictionary.cs
- SqlClientPermission.cs
- ControlValuePropertyAttribute.cs
- EntityReference.cs
- DirectionalLight.cs
- SkipStoryboardToFill.cs
- ALinqExpressionVisitor.cs
- OleDbInfoMessageEvent.cs
- LayoutDump.cs
- CaseInsensitiveComparer.cs
- OracleConnectionFactory.cs
- SecurityTokenValidationException.cs
- __ConsoleStream.cs
- IgnoreDeviceFilterElementCollection.cs
- ProcessHostMapPath.cs
- ComplexObject.cs
- TextShapeableCharacters.cs
- FullTextBreakpoint.cs
- XmlDocumentSurrogate.cs
- FocusChangedEventArgs.cs
- PartitionerQueryOperator.cs
- TypeDelegator.cs
- ArgumentNullException.cs
- DeclaredTypeValidatorAttribute.cs
- Avt.cs
- SQLMoney.cs
- TargetConverter.cs
- DebugView.cs
- BasicBrowserDialog.cs
- QueryRewriter.cs
- FormClosingEvent.cs
- X500Name.cs
- ParenthesizePropertyNameAttribute.cs
- WebBrowserContainer.cs
- TargetPerspective.cs
- LayoutExceptionEventArgs.cs
- BindingListCollectionView.cs
- CompilerLocalReference.cs
- RotateTransform3D.cs
- RadioButton.cs
- SessionIDManager.cs
- CommandPlan.cs
- Transform.cs
- WebReferenceCollection.cs
- Properties.cs
- mil_commands.cs
- FormViewDeleteEventArgs.cs
- XamlTypeMapper.cs
- SyntaxCheck.cs
- VisualBrush.cs
- XmlSchemaGroup.cs
- MessageQueueKey.cs
- SafeNativeMethods.cs
- UnsafeNativeMethodsPenimc.cs
- Resources.Designer.cs
- InputManager.cs
- Control.cs
- MSHTMLHost.cs
- PrtTicket_Editor.cs
- HtmlTableRowCollection.cs
- ConstructorExpr.cs
- Point3D.cs
- MeshGeometry3D.cs
- PersistChildrenAttribute.cs
- Html32TextWriter.cs
- HwndHostAutomationPeer.cs
- EntityContainerAssociationSetEnd.cs
- Line.cs
- PropertyMetadata.cs
- CustomCredentialPolicy.cs
- CapabilitiesUse.cs
- XamlPointCollectionSerializer.cs
- TrackingCondition.cs
- ButtonStandardAdapter.cs
- HashRepartitionStream.cs
- TextHintingModeValidation.cs
- AssemblyAttributes.cs
- SortExpressionBuilder.cs
- FixedPageProcessor.cs
- TextTreePropertyUndoUnit.cs
- OleDbMetaDataFactory.cs
- DependencyPropertyConverter.cs
- Event.cs
- NamespaceMapping.cs
- ScrollChangedEventArgs.cs
- DefaultExpression.cs
- BaseParaClient.cs
- DataMemberConverter.cs
- ReadOnlyMetadataCollection.cs
- MergeFilterQuery.cs
- TabControlCancelEvent.cs