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
- ServiceCredentialsElement.cs
- AccessibilityHelperForVista.cs
- IgnoreFileBuildProvider.cs
- CacheMemory.cs
- InternalTransaction.cs
- FocusTracker.cs
- IndicCharClassifier.cs
- MailSettingsSection.cs
- ContractAdapter.cs
- EncodingInfo.cs
- Section.cs
- RbTree.cs
- DataGridCell.cs
- CurrencyManager.cs
- Bits.cs
- DrawingCollection.cs
- PeerInvitationResponse.cs
- TabletDeviceInfo.cs
- XmlIgnoreAttribute.cs
- EdmTypeAttribute.cs
- SecureUICommand.cs
- Currency.cs
- SystemException.cs
- Int16KeyFrameCollection.cs
- ClientData.cs
- InvokeAction.cs
- BidPrivateBase.cs
- ControlSerializer.cs
- DesignerOptionService.cs
- XmlDictionaryReaderQuotas.cs
- DispatchWrapper.cs
- ObjectDataSourceWizardForm.cs
- EventHandlersStore.cs
- _HeaderInfoTable.cs
- CodeDirectiveCollection.cs
- odbcmetadatafactory.cs
- OutputCacheModule.cs
- SubtreeProcessor.cs
- ETagAttribute.cs
- CaseStatementSlot.cs
- DesignSurfaceManager.cs
- SerializationAttributes.cs
- FixedSOMImage.cs
- UndoEngine.cs
- RangeValidator.cs
- SkewTransform.cs
- Publisher.cs
- ObjectDataSourceEventArgs.cs
- ViewCellRelation.cs
- ObjectHandle.cs
- BooleanConverter.cs
- TagMapCollection.cs
- PageHandlerFactory.cs
- ProcessHostServerConfig.cs
- CancellationTokenRegistration.cs
- BaseDataListComponentEditor.cs
- SHA512.cs
- StylusButton.cs
- APCustomTypeDescriptor.cs
- QuaternionRotation3D.cs
- SchemaEntity.cs
- PerformanceCounterPermissionEntry.cs
- PixelFormats.cs
- BitConverter.cs
- BeginGetFileNameFromUserRequest.cs
- StringToken.cs
- DynamicILGenerator.cs
- OracleEncoding.cs
- LocationSectionRecord.cs
- CacheEntry.cs
- Odbc32.cs
- BinaryFormatter.cs
- AdRotator.cs
- ValidatingReaderNodeData.cs
- MouseGesture.cs
- DictionarySectionHandler.cs
- List.cs
- Animatable.cs
- EdmComplexTypeAttribute.cs
- IgnorePropertiesAttribute.cs
- OdbcParameter.cs
- XmlSchemaException.cs
- UnmanagedMemoryStream.cs
- PinnedBufferMemoryStream.cs
- CustomCredentialPolicy.cs
- SupportingTokenDuplexChannel.cs
- ClientSettingsStore.cs
- SchemaContext.cs
- tibetanshape.cs
- PreservationFileWriter.cs
- DependencyPropertyDescriptor.cs
- NetworkAddressChange.cs
- CopyOnWriteList.cs
- ScrollEventArgs.cs
- SuppressMergeCheckAttribute.cs
- _UriSyntax.cs
- AutomationPropertyInfo.cs
- DataRecordInternal.cs
- DbDataRecord.cs
- Vector3DAnimationBase.cs