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
- FileDialogPermission.cs
- SHA384.cs
- HttpListenerRequest.cs
- RbTree.cs
- FixedTextBuilder.cs
- WmlLinkAdapter.cs
- SymLanguageType.cs
- ProtocolsConfiguration.cs
- SequentialWorkflowHeaderFooter.cs
- MobileControlsSectionHandler.cs
- ISessionStateStore.cs
- FixedSOMLineRanges.cs
- StrokeCollection2.cs
- PickDesigner.xaml.cs
- UpDownEvent.cs
- NullReferenceException.cs
- DataGridViewColumnTypePicker.cs
- CompModHelpers.cs
- DesignerForm.cs
- WebEventCodes.cs
- HtmlAnchor.cs
- HandleCollector.cs
- ToolBarDesigner.cs
- ComponentDispatcher.cs
- XamlPoint3DCollectionSerializer.cs
- NameTable.cs
- ToolStripSeparator.cs
- UnsafeNativeMethodsCLR.cs
- DrawListViewItemEventArgs.cs
- WinEventTracker.cs
- OdbcDataAdapter.cs
- WaitForChangedResult.cs
- XXXOnTypeBuilderInstantiation.cs
- TableLayoutSettings.cs
- OutputCacheSettingsSection.cs
- ProgressBarHighlightConverter.cs
- DeadCharTextComposition.cs
- EntityDesignerDataSourceView.cs
- ActivitySurrogateSelector.cs
- MultiTouchSystemGestureLogic.cs
- FieldBuilder.cs
- StorageEntitySetMapping.cs
- ProfileManager.cs
- XmlChildNodes.cs
- QualificationDataItem.cs
- RadioButton.cs
- RemoteWebConfigurationHostServer.cs
- CacheOutputQuery.cs
- KeyedHashAlgorithm.cs
- PointHitTestParameters.cs
- WebBrowserProgressChangedEventHandler.cs
- ImageIndexConverter.cs
- ArgumentOutOfRangeException.cs
- TypeExtensions.cs
- AutomationInteropProvider.cs
- ToolStripDropDownMenu.cs
- SqlDataSourceSelectingEventArgs.cs
- UnitySerializationHolder.cs
- ReferenceEqualityComparer.cs
- CompiledRegexRunnerFactory.cs
- CompatibleComparer.cs
- QuadTree.cs
- LinkArea.cs
- StickyNoteContentControl.cs
- ColumnTypeConverter.cs
- HScrollProperties.cs
- ExpressionBuilderCollection.cs
- ThicknessAnimationBase.cs
- ActiveDocumentEvent.cs
- GridView.cs
- mediaeventshelper.cs
- ScrollItemPatternIdentifiers.cs
- BaseDataBoundControl.cs
- SiteMapSection.cs
- _Win32.cs
- IconBitmapDecoder.cs
- HtmlMeta.cs
- DeploymentSection.cs
- RelationshipFixer.cs
- FileUtil.cs
- SafeEventLogReadHandle.cs
- ResXDataNode.cs
- MemberDomainMap.cs
- CodeTypeOfExpression.cs
- CodeAttributeArgument.cs
- HierarchicalDataSourceConverter.cs
- ToolTipAutomationPeer.cs
- TableCell.cs
- XmlSerializableReader.cs
- UdpRetransmissionSettings.cs
- GuidelineSet.cs
- followingquery.cs
- SBCSCodePageEncoding.cs
- DiscoveryReferences.cs
- EndEvent.cs
- TextFormatterImp.cs
- PageThemeCodeDomTreeGenerator.cs
- DocumentGridPage.cs
- XMLSchema.cs
- CollectionChangedEventManager.cs