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
- WmpBitmapDecoder.cs
- MILUtilities.cs
- ObjectPropertyMapping.cs
- InvokeWebService.cs
- WithParamAction.cs
- ListViewGroup.cs
- EncoderNLS.cs
- EncodingNLS.cs
- _LocalDataStore.cs
- fixedPageContentExtractor.cs
- NetworkCredential.cs
- TemplateBindingExtensionConverter.cs
- ControlDesigner.cs
- URLMembershipCondition.cs
- Button.cs
- followingquery.cs
- CodeDirectoryCompiler.cs
- RuleInfoComparer.cs
- RootAction.cs
- metadatamappinghashervisitor.cs
- LinkLabel.cs
- ConnectionOrientedTransportChannelListener.cs
- ArrayExtension.cs
- RightsManagementResourceHelper.cs
- XsdValidatingReader.cs
- NestPullup.cs
- SecureStringHasher.cs
- FieldBuilder.cs
- __Filters.cs
- DefaultTypeArgumentAttribute.cs
- DecimalAnimationBase.cs
- basecomparevalidator.cs
- DispatcherProcessingDisabled.cs
- TableLayoutSettingsTypeConverter.cs
- ObjectSecurity.cs
- EventLogTraceListener.cs
- InvokeGenerator.cs
- EntityDataSourceContextCreatedEventArgs.cs
- AllowedAudienceUriElement.cs
- PathFigure.cs
- PropertyEntry.cs
- ToolStripOverflow.cs
- DateTimeOffsetAdapter.cs
- ProcessThread.cs
- TimeSpanValidator.cs
- CodeTypeDelegate.cs
- BooleanAnimationBase.cs
- QuaternionConverter.cs
- HandlerBase.cs
- Registry.cs
- ManagementExtension.cs
- BlobPersonalizationState.cs
- InvalidProgramException.cs
- BitmapData.cs
- ScrollItemPatternIdentifiers.cs
- LocalizationParserHooks.cs
- SortAction.cs
- _ProxyChain.cs
- ObjectStateEntry.cs
- DataServiceQueryProvider.cs
- Repeater.cs
- HtmlElementErrorEventArgs.cs
- ReadWriteObjectLock.cs
- FixedSchema.cs
- NameValueConfigurationCollection.cs
- NullToBooleanConverter.cs
- ArrowControl.xaml.cs
- NativeRecognizer.cs
- Label.cs
- OleDbFactory.cs
- VisualCollection.cs
- PositiveTimeSpanValidator.cs
- ManagementObject.cs
- AnonymousIdentificationModule.cs
- DatagramAdapter.cs
- XmlHierarchicalDataSourceView.cs
- ImageListDesigner.cs
- GregorianCalendar.cs
- FixedDSBuilder.cs
- OneOfScalarConst.cs
- XmlSignificantWhitespace.cs
- DispatchChannelSink.cs
- MaskedTextBox.cs
- InvokePattern.cs
- ActivityBuilder.cs
- DocumentReference.cs
- EnumBuilder.cs
- GlyphingCache.cs
- WebBrowserUriTypeConverter.cs
- SimpleTypeResolver.cs
- XmlSequenceWriter.cs
- Canvas.cs
- ToolStripDesigner.cs
- FlowDocumentReaderAutomationPeer.cs
- TreeNodeSelectionProcessor.cs
- ListViewDataItem.cs
- BamlRecordHelper.cs
- DataTrigger.cs
- PointConverter.cs
- JournalNavigationScope.cs