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
- CompilerError.cs
- PerformanceCounterLib.cs
- XmlSchemaObjectTable.cs
- Matrix.cs
- DirectoryRootQuery.cs
- WmlFormAdapter.cs
- ImmutablePropertyDescriptorGridEntry.cs
- ManagedWndProcTracker.cs
- ClientApiGenerator.cs
- HostingEnvironmentWrapper.cs
- OleDbPermission.cs
- DrawingBrush.cs
- OleDbParameter.cs
- GridItemProviderWrapper.cs
- HttpSysSettings.cs
- WorkflowExecutor.cs
- PerformanceCounter.cs
- MultiAsyncResult.cs
- MgmtConfigurationRecord.cs
- ScalarType.cs
- SkinIDTypeConverter.cs
- WizardSideBarListControlItem.cs
- TableItemStyle.cs
- ChildTable.cs
- ScriptIgnoreAttribute.cs
- SqlUtils.cs
- WindowsSysHeader.cs
- SafeLibraryHandle.cs
- FilterFactory.cs
- ComponentSerializationService.cs
- DbProviderSpecificTypePropertyAttribute.cs
- PreservationFileReader.cs
- QueryCacheManager.cs
- DiscreteKeyFrames.cs
- BaseTemplateBuildProvider.cs
- XsltFunctions.cs
- MsmqBindingFilter.cs
- ProfileManager.cs
- VirtualPath.cs
- Exceptions.cs
- MinMaxParagraphWidth.cs
- AsyncDataRequest.cs
- NullableLongMinMaxAggregationOperator.cs
- Quaternion.cs
- odbcmetadatacollectionnames.cs
- Mutex.cs
- TransactionInterop.cs
- DiscoveryInnerClientAdhocCD1.cs
- Crypto.cs
- ObjectDataSourceWizardForm.cs
- SelectionPattern.cs
- EntityDataSourceView.cs
- CircleHotSpot.cs
- ListItemParagraph.cs
- TypeLoadException.cs
- MetadataArtifactLoader.cs
- TiffBitmapEncoder.cs
- WebConfigurationManager.cs
- WebPageTraceListener.cs
- SiteMapSection.cs
- PropertyTab.cs
- StorageInfo.cs
- SynchronizedDispatch.cs
- DelegateTypeInfo.cs
- DataKeyCollection.cs
- Expression.cs
- WindowsStatusBar.cs
- Profiler.cs
- NativeActivityMetadata.cs
- FormViewUpdateEventArgs.cs
- DefaultAuthorizationContext.cs
- XmlNode.cs
- ToolStripPanelSelectionGlyph.cs
- AssemblySettingAttributes.cs
- AnnouncementInnerClientCD1.cs
- FusionWrap.cs
- FileVersion.cs
- LassoHelper.cs
- SqlTransaction.cs
- HGlobalSafeHandle.cs
- NopReturnReader.cs
- InputManager.cs
- FileUpload.cs
- CroppedBitmap.cs
- PathParser.cs
- DataTemplateKey.cs
- HtmlTable.cs
- XmlException.cs
- OdbcTransaction.cs
- DrawingAttributeSerializer.cs
- RenderData.cs
- ControlIdConverter.cs
- GlobalEventManager.cs
- ButtonFlatAdapter.cs
- BooleanAnimationUsingKeyFrames.cs
- CodeGotoStatement.cs
- WindowsSolidBrush.cs
- Soap.cs
- SqlClientPermission.cs
- ListViewPagedDataSource.cs