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
- BlockUIContainer.cs
- AccessibleObject.cs
- ListBoxItemAutomationPeer.cs
- ResourceDescriptionAttribute.cs
- DataGridDesigner.cs
- RegexInterpreter.cs
- RC2.cs
- StrongNamePublicKeyBlob.cs
- SafeUserTokenHandle.cs
- CollectionBuilder.cs
- WebServiceErrorEvent.cs
- ActiveXHelper.cs
- SafeCryptoHandles.cs
- SymbolTable.cs
- StreamWriter.cs
- VisualStyleInformation.cs
- DataServiceProcessingPipelineEventArgs.cs
- UserPreferenceChangedEventArgs.cs
- TimeIntervalCollection.cs
- HtmlInputCheckBox.cs
- securitymgrsite.cs
- ListControlDataBindingHandler.cs
- RegisteredScript.cs
- AsyncWaitHandle.cs
- KeyNotFoundException.cs
- ManagedCodeMarkers.cs
- HttpCacheParams.cs
- RawUIStateInputReport.cs
- XmlBoundElement.cs
- CaseCqlBlock.cs
- MarginCollapsingState.cs
- ExpressionLexer.cs
- StrokeNode.cs
- AutoCompleteStringCollection.cs
- DesignSurfaceEvent.cs
- ProviderConnectionPoint.cs
- StatusBar.cs
- DetailsViewDeletedEventArgs.cs
- SiteMapDataSource.cs
- EntityConnectionStringBuilder.cs
- DrawingVisual.cs
- CodeSubDirectoriesCollection.cs
- RowParagraph.cs
- ScrollChrome.cs
- ASCIIEncoding.cs
- MSAAEventDispatcher.cs
- PeerCredential.cs
- DisposableCollectionWrapper.cs
- CompilerTypeWithParams.cs
- VideoDrawing.cs
- BitmapMetadataBlob.cs
- IArgumentProvider.cs
- RealProxy.cs
- MessageSecurityProtocol.cs
- ValidationSummary.cs
- XMLSyntaxException.cs
- Timer.cs
- StorageMappingItemCollection.cs
- CustomAttributeSerializer.cs
- _Rfc2616CacheValidators.cs
- Attribute.cs
- Registry.cs
- _SslState.cs
- DataControlFieldCollection.cs
- ImageConverter.cs
- RoleGroup.cs
- NullableIntMinMaxAggregationOperator.cs
- PropertyGridView.cs
- JsonReader.cs
- DataBindingsDialog.cs
- ContentType.cs
- SortDescription.cs
- XamlFilter.cs
- RelationHandler.cs
- OleDbEnumerator.cs
- ProbeMatchesMessage11.cs
- Soap11ServerProtocol.cs
- DataGridViewCell.cs
- SqlDeflator.cs
- MergablePropertyAttribute.cs
- DataGridViewEditingControlShowingEventArgs.cs
- Exception.cs
- PageBreakRecord.cs
- TextLine.cs
- RelationshipFixer.cs
- XhtmlBasicObjectListAdapter.cs
- Panel.cs
- WebPartConnectionsCancelEventArgs.cs
- CharEntityEncoderFallback.cs
- TerminateSequenceResponse.cs
- OrthographicCamera.cs
- LineBreak.cs
- ITextView.cs
- BamlCollectionHolder.cs
- TableHeaderCell.cs
- ConstraintEnumerator.cs
- GradientStop.cs
- BaseParser.cs
- DesigntimeLicenseContext.cs
- LineUtil.cs