Code:
/ DotNET / DotNET / 8.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
- EntityDataSourceDesignerHelper.cs
- NetPeerTcpBindingCollectionElement.cs
- WebPartDisplayModeCollection.cs
- ListControlConvertEventArgs.cs
- UInt64.cs
- TextTreeObjectNode.cs
- TransactionBridge.cs
- StrokeNodeData.cs
- TypeLoadException.cs
- XPathPatternParser.cs
- MethodBuilder.cs
- ZipIOCentralDirectoryFileHeader.cs
- SqlNamer.cs
- InfoCardProofToken.cs
- PartialCachingAttribute.cs
- EntityWrapper.cs
- ImageCodecInfoPrivate.cs
- ObjectStateEntryDbDataRecord.cs
- WindowsStreamSecurityBindingElement.cs
- TextEncodedRawTextWriter.cs
- XmlSchemaFacet.cs
- HtmlInputReset.cs
- SQLDouble.cs
- TimeSpanSecondsConverter.cs
- TagMapInfo.cs
- IdentitySection.cs
- CompilerErrorCollection.cs
- RequestResizeEvent.cs
- GraphicsPathIterator.cs
- IList.cs
- TransformerInfoCollection.cs
- XPathAncestorQuery.cs
- ImageListUtils.cs
- ProfileSection.cs
- WindowsContainer.cs
- DelegateHelpers.Generated.cs
- ConfigurationSection.cs
- Cursor.cs
- LinkButton.cs
- ConfigurationStrings.cs
- ProxyElement.cs
- HtmlElement.cs
- TreeViewImageIndexConverter.cs
- CollectionBuilder.cs
- PreviewControlDesigner.cs
- StylusDevice.cs
- HtmlHead.cs
- SendMailErrorEventArgs.cs
- GridSplitterAutomationPeer.cs
- SpotLight.cs
- XmlSchemaInferenceException.cs
- NoResizeSelectionBorderGlyph.cs
- Int32Converter.cs
- UnauthorizedAccessException.cs
- ToolBarTray.cs
- CommandHelpers.cs
- AutomationProperty.cs
- HttpListenerPrefixCollection.cs
- HttpListenerElement.cs
- CommandEventArgs.cs
- Pointer.cs
- KeyEvent.cs
- VBCodeProvider.cs
- IIS7UserPrincipal.cs
- StorageTypeMapping.cs
- RawUIStateInputReport.cs
- InternalsVisibleToAttribute.cs
- SimpleHandlerBuildProvider.cs
- MessageBodyDescription.cs
- SortQuery.cs
- TriState.cs
- ExpressionNormalizer.cs
- PasswordBox.cs
- SR.cs
- MappedMetaModel.cs
- Control.cs
- OfTypeExpression.cs
- RtType.cs
- XmlDataProvider.cs
- OracleException.cs
- QueryCursorEventArgs.cs
- RelationshipFixer.cs
- JpegBitmapDecoder.cs
- InvokeWebServiceDesigner.cs
- SequentialUshortCollection.cs
- ConfigurationCollectionAttribute.cs
- Line.cs
- UpdatePanel.cs
- ServiceObjectContainer.cs
- VectorCollectionConverter.cs
- ErrorFormatter.cs
- HandleCollector.cs
- WebAdminConfigurationHelper.cs
- ArgumentDesigner.xaml.cs
- DataGridRelationshipRow.cs
- MouseButton.cs
- CodeRemoveEventStatement.cs
- StandardToolWindows.cs
- StaticContext.cs
- UInt16Converter.cs