Code:
/ FX-1434 / FX-1434 / 1.0 / untmp / whidbey / REDBITS / ndp / fx / src / Designer / CompMod / System / ComponentModel / Design / RuntimeComponentFilter.cs / 1 / RuntimeComponentFilter.cs
//------------------------------------------------------------------------------ //// Copyright (c) Microsoft Corporation. All rights reserved. // //----------------------------------------------------------------------------- /* */ namespace System.ComponentModel.Design { using System.Design; using System.Runtime.InteropServices; using System.ComponentModel; using System.Diagnostics; using System; using System.Collections; using System.Reflection; using System.Windows.Forms; using Microsoft.Win32; using System.Windows.Forms.Design; using System.Windows.Forms.ComponentModel; internal static class RuntimeComponentFilter { public static void FilterProperties(IDictionary properties, ICollection makeReadWrite, ICollection makeBrowsable) { FilterProperties(properties, makeReadWrite, makeBrowsable, null); } public static void FilterProperties(IDictionary properties, ICollection makeReadWrite, ICollection makeBrowsable, bool[] browsableSettings) { if (makeReadWrite != null) { foreach (string name in makeReadWrite) { PropertyDescriptor readOnlyProp = properties[name] as PropertyDescriptor; if (readOnlyProp != null) { properties[name] = TypeDescriptor.CreateProperty(readOnlyProp.ComponentType, readOnlyProp, ReadOnlyAttribute.No); } else { Debug.Fail("Didn't find property '" + name + "' to make read/write"); } } } if (makeBrowsable != null) { int count = -1; Debug.Assert(browsableSettings == null || browsableSettings.Length == makeBrowsable.Count, "browsableSettings must be null or same length as makeBrowsable"); foreach (string name in makeBrowsable) { PropertyDescriptor nonBrowsableProp = properties[name] as PropertyDescriptor; count++; if (nonBrowsableProp != null) { Attribute browse; if (browsableSettings == null || browsableSettings[count]) { browse = BrowsableAttribute.Yes; } else { browse = BrowsableAttribute.No; } properties[name] = TypeDescriptor.CreateProperty(nonBrowsableProp.ComponentType, nonBrowsableProp, browse); } else { Debug.Fail("Didn't find property '" + name + "' to make browsable"); } } } } } } // 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
- BinaryWriter.cs
- DependentList.cs
- TextElement.cs
- URIFormatException.cs
- GetReadStreamResult.cs
- AddInAdapter.cs
- ClientUtils.cs
- BuildManager.cs
- ConversionContext.cs
- glyphs.cs
- FlowchartDesigner.Helpers.cs
- MappingModelBuildProvider.cs
- returneventsaver.cs
- CultureSpecificStringDictionary.cs
- ButtonChrome.cs
- Semaphore.cs
- HuffModule.cs
- FileDialog.cs
- Win32.cs
- DataGridViewRowErrorTextNeededEventArgs.cs
- ProviderIncompatibleException.cs
- CellPartitioner.cs
- XmlStreamNodeWriter.cs
- CompilationUnit.cs
- DataControlButton.cs
- PropertyItem.cs
- FillErrorEventArgs.cs
- NavigationFailedEventArgs.cs
- XmlMembersMapping.cs
- ByteAnimation.cs
- ScriptManager.cs
- RepeatButton.cs
- TrackingRecord.cs
- ScriptControl.cs
- WebPartConnectionsConfigureVerb.cs
- ListViewInsertionMark.cs
- EntityDataSourceEntityTypeFilterConverter.cs
- TreeNodeEventArgs.cs
- OrderedParallelQuery.cs
- ProjectedSlot.cs
- Transform.cs
- SqlDataSourceView.cs
- CultureTable.cs
- OdbcError.cs
- SoapServerMessage.cs
- HtmlHead.cs
- AttributedMetaModel.cs
- VisualStateGroup.cs
- UnmanagedMarshal.cs
- EntityProviderFactory.cs
- TlsnegoTokenAuthenticator.cs
- RowUpdatingEventArgs.cs
- StructuredProperty.cs
- IdentityNotMappedException.cs
- XhtmlTextWriter.cs
- BufferedStream.cs
- ConfigXmlAttribute.cs
- XmlWrappingWriter.cs
- CommonXSendMessage.cs
- HotSpotCollection.cs
- XmlNavigatorStack.cs
- ContainerSelectorBehavior.cs
- CompilationUnit.cs
- CalendarDateChangedEventArgs.cs
- ConversionHelper.cs
- RowCache.cs
- ConnectivityStatus.cs
- MailDefinition.cs
- SerializationException.cs
- DbConnectionPoolGroup.cs
- PerfCounters.cs
- MasterPageBuildProvider.cs
- SingleTagSectionHandler.cs
- ClientRolePrincipal.cs
- SizeConverter.cs
- GetIndexBinder.cs
- AdjustableArrowCap.cs
- Sql8ConformanceChecker.cs
- SiteOfOriginContainer.cs
- _SSPIWrapper.cs
- DoubleLinkList.cs
- EntityDesignerDataSourceView.cs
- PagesChangedEventArgs.cs
- GlyphRunDrawing.cs
- DbQueryCommandTree.cs
- SymbolType.cs
- GeneratedView.cs
- ChangeConflicts.cs
- ListViewTableCell.cs
- DetailsViewActionList.cs
- XmlSchemaImporter.cs
- SpellerStatusTable.cs
- ComplexBindingPropertiesAttribute.cs
- ExpressionBinding.cs
- ScrollItemProviderWrapper.cs
- WebPartEventArgs.cs
- TreeView.cs
- Highlights.cs
- SrgsDocumentParser.cs
- ViewStateException.cs