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
- VoiceChangeEventArgs.cs
- DateTimeFormatInfo.cs
- GradientStop.cs
- IdentifierCreationService.cs
- FontEmbeddingManager.cs
- WindowsComboBox.cs
- KeyBinding.cs
- SecurityCriticalDataForSet.cs
- FieldTemplateFactory.cs
- SaveWorkflowCommand.cs
- QueryCacheKey.cs
- TextDecoration.cs
- AmbientLight.cs
- loginstatus.cs
- LinqDataSourceContextEventArgs.cs
- TextBoxAutomationPeer.cs
- AnyAllSearchOperator.cs
- TemplateInstanceAttribute.cs
- MachineSettingsSection.cs
- DataGridDesigner.cs
- WebCategoryAttribute.cs
- InfoCardCryptoHelper.cs
- ListControlConvertEventArgs.cs
- ThreadStartException.cs
- DesignerSerializerAttribute.cs
- xml.cs
- DataGridView.cs
- AvTrace.cs
- BooleanConverter.cs
- BaseCollection.cs
- CornerRadiusConverter.cs
- InheritablePropertyChangeInfo.cs
- DetailsViewRow.cs
- MatrixStack.cs
- CodeTypeOfExpression.cs
- OrderPreservingSpoolingTask.cs
- CatalogZoneBase.cs
- _OverlappedAsyncResult.cs
- XmlSchemaInclude.cs
- CustomAssemblyResolver.cs
- X509UI.cs
- SafeReversePInvokeHandle.cs
- List.cs
- TypeBuilderInstantiation.cs
- NameValuePermission.cs
- SystemColors.cs
- TextTreeInsertElementUndoUnit.cs
- Currency.cs
- _Win32.cs
- OptimalBreakSession.cs
- HttpWebRequest.cs
- DateTimePickerDesigner.cs
- DbReferenceCollection.cs
- PrivateFontCollection.cs
- AnonymousIdentificationSection.cs
- Nodes.cs
- DefaultSerializationProviderAttribute.cs
- SqlDependencyUtils.cs
- XmlAttributeCollection.cs
- SID.cs
- SmtpLoginAuthenticationModule.cs
- InstallerTypeAttribute.cs
- TransactionException.cs
- ExpressionDumper.cs
- DataQuery.cs
- ServiceInfo.cs
- XmlTextWriter.cs
- EncoderExceptionFallback.cs
- HttpHandler.cs
- DataGridCell.cs
- TimeSpanSecondsOrInfiniteConverter.cs
- ComboBox.cs
- AdapterDictionary.cs
- InvalidAsynchronousStateException.cs
- DataObjectCopyingEventArgs.cs
- EditorPartCollection.cs
- ButtonBase.cs
- FormViewRow.cs
- FilteredAttributeCollection.cs
- DelayedRegex.cs
- IpcServerChannel.cs
- ProviderConnectionPoint.cs
- StrokeNode.cs
- OleDbException.cs
- FixedTextPointer.cs
- IndentedWriter.cs
- DataSourceViewSchemaConverter.cs
- StylusPlugin.cs
- TargetInvocationException.cs
- FixedSOMTextRun.cs
- AdapterDictionary.cs
- ComNativeDescriptor.cs
- QilList.cs
- ClientType.cs
- XmlLoader.cs
- ScrollViewerAutomationPeer.cs
- Activator.cs
- FixedSOMLineCollection.cs
- AncillaryOps.cs
- x509utils.cs