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
- ProxyHelper.cs
- UrlMappingsModule.cs
- FileDialogCustomPlacesCollection.cs
- RangeValuePatternIdentifiers.cs
- InvalidProgramException.cs
- BlurEffect.cs
- COM2ComponentEditor.cs
- ObjectParameter.cs
- HandleValueEditor.cs
- DataGridViewCellConverter.cs
- ToolStripOverflow.cs
- BufferedStream.cs
- BindingManagerDataErrorEventArgs.cs
- Action.cs
- SslStream.cs
- SafeArrayRankMismatchException.cs
- EventHandlersDesigner.cs
- StyleBamlTreeBuilder.cs
- DockPatternIdentifiers.cs
- HtmlInputReset.cs
- StateItem.cs
- GlobalizationAssembly.cs
- figurelength.cs
- PartialCachingAttribute.cs
- PropertyGrid.cs
- CodeMemberEvent.cs
- CustomErrorsSectionWrapper.cs
- TabControlCancelEvent.cs
- AddressingProperty.cs
- ConnectionConsumerAttribute.cs
- ILGenerator.cs
- InfoCardKeyedHashAlgorithm.cs
- CopyAction.cs
- NameValueFileSectionHandler.cs
- SqlExpander.cs
- SafeArrayTypeMismatchException.cs
- HttpProfileGroupBase.cs
- AccessibleObject.cs
- datacache.cs
- AutomationElementIdentifiers.cs
- X509Certificate2.cs
- IdentityHolder.cs
- SymbolDocumentInfo.cs
- UnionCodeGroup.cs
- FloaterBaseParaClient.cs
- DataGridItem.cs
- EventProperty.cs
- MarkupExtensionParser.cs
- MessageSmuggler.cs
- SiteMapNodeItem.cs
- GridViewDeletedEventArgs.cs
- TextElementEnumerator.cs
- StringInfo.cs
- MemberDomainMap.cs
- securitycriticaldataClass.cs
- CallbackValidator.cs
- DataListGeneralPage.cs
- XmlSchemaSimpleTypeUnion.cs
- RectAnimation.cs
- IPCCacheManager.cs
- HasCopySemanticsAttribute.cs
- ApplyImportsAction.cs
- TraceListener.cs
- Validator.cs
- UserNameSecurityTokenProvider.cs
- SqlDelegatedTransaction.cs
- Configuration.cs
- RtfFormatStack.cs
- StructuredProperty.cs
- Point3DKeyFrameCollection.cs
- MsdtcClusterUtils.cs
- AssociationSetEnd.cs
- Walker.cs
- VoiceSynthesis.cs
- MsmqIntegrationMessagePool.cs
- DiffuseMaterial.cs
- ClipboardData.cs
- EventProxy.cs
- SQLGuidStorage.cs
- SoapEnumAttribute.cs
- BaseDataList.cs
- KnownColorTable.cs
- SafeReadContext.cs
- ControlPropertyNameConverter.cs
- UpdateTracker.cs
- PersonalizableTypeEntry.cs
- UpWmlPageAdapter.cs
- WebServiceData.cs
- EntitySetBaseCollection.cs
- GlyphInfoList.cs
- WebServiceErrorEvent.cs
- bidPrivateBase.cs
- ResourceManager.cs
- CheckBoxAutomationPeer.cs
- Matrix3DStack.cs
- TextElement.cs
- FrameworkRichTextComposition.cs
- FrugalMap.cs
- MouseButton.cs
- ObjectStateEntry.cs