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
- DriveInfo.cs
- DesignerOptionService.cs
- XmlTextWriter.cs
- DataViewManager.cs
- JsonFormatMapping.cs
- DiscreteKeyFrames.cs
- ClosureBinding.cs
- TargetControlTypeCache.cs
- PageStatePersister.cs
- HtmlShim.cs
- HideDisabledControlAdapter.cs
- WebPartConnectionsEventArgs.cs
- FixUp.cs
- StubHelpers.cs
- DefaultAssemblyResolver.cs
- RegexCharClass.cs
- EncryptedData.cs
- ExpandedWrapper.cs
- XmlSchemaAppInfo.cs
- printdlgexmarshaler.cs
- SafeEventLogReadHandle.cs
- ProcessExitedException.cs
- NameSpaceExtractor.cs
- AccessDataSourceWizardForm.cs
- OdbcConnectionString.cs
- keycontainerpermission.cs
- GenericWebPart.cs
- Span.cs
- GridEntry.cs
- XamlVector3DCollectionSerializer.cs
- UnmanagedMemoryStream.cs
- TemplateEditingService.cs
- EntityReference.cs
- StateMachineTimers.cs
- SQLStringStorage.cs
- FocusChangedEventArgs.cs
- InstanceKey.cs
- UnmanagedMemoryStreamWrapper.cs
- WebBrowser.cs
- AudioFormatConverter.cs
- CompiledQueryCacheEntry.cs
- HuffmanTree.cs
- MeasureItemEvent.cs
- GenerateHelper.cs
- SecurityUtils.cs
- Form.cs
- ConfigurationPermission.cs
- PointLight.cs
- AssertSection.cs
- TypeToArgumentTypeConverter.cs
- DBPropSet.cs
- PageThemeBuildProvider.cs
- DrawingGroup.cs
- ExeContext.cs
- LineMetrics.cs
- PackagingUtilities.cs
- ToolStripItemImageRenderEventArgs.cs
- OperationPerformanceCounters.cs
- Permission.cs
- EasingQuaternionKeyFrame.cs
- MsmqInputSessionChannelListener.cs
- AuthenticationModuleElementCollection.cs
- ObjectDataSourceMethodEditor.cs
- DynamicFilter.cs
- TraceContext.cs
- ContextToken.cs
- Label.cs
- XmlNodeChangedEventArgs.cs
- ProfileSection.cs
- SqlOuterApplyReducer.cs
- Assert.cs
- HtmlInputPassword.cs
- MdiWindowListItemConverter.cs
- CannotUnloadAppDomainException.cs
- StorageEntitySetMapping.cs
- XmlDomTextWriter.cs
- DataServiceQueryOfT.cs
- ParameterCollectionEditorForm.cs
- AsyncCompletedEventArgs.cs
- DataGridViewComponentPropertyGridSite.cs
- ConfigUtil.cs
- UrlPropertyAttribute.cs
- TagNameToTypeMapper.cs
- ObjectPropertyMapping.cs
- coordinator.cs
- SwitchLevelAttribute.cs
- __Filters.cs
- SqlUtils.cs
- DocumentSequenceHighlightLayer.cs
- SafeEventLogReadHandle.cs
- ShimAsPublicXamlType.cs
- TransportOutputChannel.cs
- Random.cs
- CatalogPartCollection.cs
- SystemWebCachingSectionGroup.cs
- CacheAxisQuery.cs
- NestedContainer.cs
- SQLBinary.cs
- ReturnValue.cs
- CompiledELinqQueryState.cs