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
- BindMarkupExtensionSerializer.cs
- Matrix3DValueSerializer.cs
- SecurityDescriptor.cs
- CommandBindingCollection.cs
- FaultPropagationQuery.cs
- MdiWindowListItemConverter.cs
- TableItemStyle.cs
- ContainerAction.cs
- OleDbTransaction.cs
- InternalConfigSettingsFactory.cs
- StylusPlugin.cs
- EntityDataSourceDataSelection.cs
- AttributeData.cs
- MultitargetingHelpers.cs
- CustomAttribute.cs
- RawAppCommandInputReport.cs
- SocketSettings.cs
- ScriptManager.cs
- TextRangeBase.cs
- SafeLibraryHandle.cs
- IntellisenseTextBox.designer.cs
- MenuAutoFormat.cs
- ToolStripOverflow.cs
- Constant.cs
- UserPersonalizationStateInfo.cs
- RegexGroup.cs
- DataGridViewCell.cs
- ContentType.cs
- TableColumn.cs
- RightsManagementEncryptedStream.cs
- OptimizedTemplateContent.cs
- FloaterParaClient.cs
- GetReadStreamResult.cs
- FontStretch.cs
- DataGridTextBox.cs
- Statements.cs
- WebScriptMetadataInstanceContextProvider.cs
- DBCommand.cs
- PropertyRecord.cs
- TextRange.cs
- PathSegmentCollection.cs
- IfAction.cs
- EdmConstants.cs
- OTFRasterizer.cs
- PackageFilter.cs
- DataGridViewAutoSizeModeEventArgs.cs
- Material.cs
- GeneralTransform3DTo2D.cs
- ToolStripManager.cs
- cookie.cs
- SqlCommand.cs
- Section.cs
- DataGridViewRowsAddedEventArgs.cs
- GetPageCompletedEventArgs.cs
- XmlStringTable.cs
- DataTableCollection.cs
- MissingMethodException.cs
- AlternateViewCollection.cs
- TreeNode.cs
- returneventsaver.cs
- ImpersonateTokenRef.cs
- BindingMemberInfo.cs
- CfgParser.cs
- SqlMethodCallConverter.cs
- Control.cs
- MobileControlPersister.cs
- SecurityTokenSerializer.cs
- Keywords.cs
- TransformProviderWrapper.cs
- ScopedKnownTypes.cs
- GestureRecognizer.cs
- WebSysDisplayNameAttribute.cs
- WeakReferenceKey.cs
- TreeIterator.cs
- SparseMemoryStream.cs
- Hex.cs
- ControlValuePropertyAttribute.cs
- ObjectViewFactory.cs
- EntityClientCacheKey.cs
- FeatureAttribute.cs
- ClientUrlResolverWrapper.cs
- EmptyEnumerator.cs
- ListBoxAutomationPeer.cs
- CellNormalizer.cs
- BamlTreeNode.cs
- TextRangeBase.cs
- FormatterConverter.cs
- ProfileProvider.cs
- BasePattern.cs
- HostingEnvironment.cs
- BamlStream.cs
- DataView.cs
- safelink.cs
- MD5CryptoServiceProvider.cs
- DataGridViewComboBoxCell.cs
- EmptyReadOnlyDictionaryInternal.cs
- ProcessManager.cs
- DiscoveryReferences.cs
- XmlSchemaCompilationSettings.cs
- DependencySource.cs