Code:
/ 4.0 / 4.0 / untmp / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / WinForms / Managed / System / WinForms / SpecialFolderEnumConverter.cs / 1305376 / 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.
Link Menu
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- CheckBoxList.cs
- DataContractSerializerOperationGenerator.cs
- LinkDescriptor.cs
- RequestResizeEvent.cs
- ItemContainerPattern.cs
- PrintDialogException.cs
- EntityDataSourceContextCreatedEventArgs.cs
- FileSecurity.cs
- ReferentialConstraint.cs
- PropertyCollection.cs
- TextEffect.cs
- NavigationPropertySingletonExpression.cs
- XmlSchemaDatatype.cs
- AutomationPatternInfo.cs
- RegularExpressionValidator.cs
- ContextStaticAttribute.cs
- ISAPIApplicationHost.cs
- ZipFileInfo.cs
- TagMapInfo.cs
- EditorAttributeInfo.cs
- ResourceLoader.cs
- X509SubjectKeyIdentifierClause.cs
- AutoGeneratedFieldProperties.cs
- ConfigurationLocation.cs
- TemplatePagerField.cs
- BamlMapTable.cs
- WmlFormAdapter.cs
- WmlCalendarAdapter.cs
- TextChangedEventArgs.cs
- TransformedBitmap.cs
- LayoutEditorPart.cs
- ExpressionBuilder.cs
- CleanUpVirtualizedItemEventArgs.cs
- XmlChildEnumerator.cs
- Trace.cs
- Msec.cs
- HtmlButton.cs
- ProxySimple.cs
- ControlPaint.cs
- NodeLabelEditEvent.cs
- EntityTemplateFactory.cs
- NullableIntAverageAggregationOperator.cs
- BufferedGraphicsContext.cs
- SqlClientWrapperSmiStream.cs
- EventLogPermission.cs
- ObjectFactoryCodeDomTreeGenerator.cs
- ApplicationContext.cs
- FileDialog_Vista.cs
- BufferedResponseStream.cs
- SemaphoreFullException.cs
- PrintDialog.cs
- RecognizerBase.cs
- BufferModeSettings.cs
- CompressStream.cs
- WebPartsPersonalization.cs
- IgnoreSection.cs
- MenuAdapter.cs
- StorageInfo.cs
- QilNode.cs
- WebPartZoneCollection.cs
- DBProviderConfigurationHandler.cs
- TemplateColumn.cs
- SSmlParser.cs
- DataGridViewRowsAddedEventArgs.cs
- HierarchicalDataBoundControlAdapter.cs
- XmlResolver.cs
- ReadOnlyPropertyMetadata.cs
- ObjectViewListener.cs
- XmlSchemaInclude.cs
- RawStylusInputCustomDataList.cs
- CharKeyFrameCollection.cs
- PingOptions.cs
- Camera.cs
- XsltLoader.cs
- PartialArray.cs
- ConditionCollection.cs
- LayoutEngine.cs
- Baml2006KnownTypes.cs
- BaseAutoFormat.cs
- ProtectedConfigurationProviderCollection.cs
- Substitution.cs
- FormClosedEvent.cs
- IISUnsafeMethods.cs
- CodeComment.cs
- PageCache.cs
- ImageButton.cs
- StructuredProperty.cs
- IsolatedStorage.cs
- ImageClickEventArgs.cs
- ArglessEventHandlerProxy.cs
- DrawingServices.cs
- ExpressionPrefixAttribute.cs
- ReflectPropertyDescriptor.cs
- hresults.cs
- EnumDataContract.cs
- DataPagerFieldItem.cs
- HealthMonitoringSection.cs
- SizeAnimation.cs
- SqlUtils.cs
- RepeatBehaviorConverter.cs