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
- CssTextWriter.cs
- ImageListDesigner.cs
- LayoutDump.cs
- _Events.cs
- ListenerAdapterBase.cs
- RequestUriProcessor.cs
- ReadContentAsBinaryHelper.cs
- BinarySerializer.cs
- StylusPlugInCollection.cs
- AutoGeneratedField.cs
- ServerProtocol.cs
- WorkflowApplicationUnhandledExceptionEventArgs.cs
- InheritedPropertyDescriptor.cs
- InvokePatternIdentifiers.cs
- SqlStatistics.cs
- CustomAssemblyResolver.cs
- ToolStripItemRenderEventArgs.cs
- DynamicDataExtensions.cs
- PixelFormat.cs
- GridViewColumnCollection.cs
- WindowsButton.cs
- ActivityMarkupSerializer.cs
- SerializationAttributes.cs
- LayoutEditorPart.cs
- ConfigurationStrings.cs
- BaseHashHelper.cs
- DoubleStorage.cs
- ConditionedDesigner.cs
- TargetControlTypeAttribute.cs
- FixedSOMLineRanges.cs
- SelectionProviderWrapper.cs
- AutoFocusStyle.xaml.cs
- Attributes.cs
- EdmRelationshipNavigationPropertyAttribute.cs
- XmlDictionaryReaderQuotas.cs
- NamedPermissionSet.cs
- PhysicalOps.cs
- _CommandStream.cs
- DirectoryInfo.cs
- ApplicationBuildProvider.cs
- CommandEventArgs.cs
- EntityDesignPluralizationHandler.cs
- ToolTipAutomationPeer.cs
- NetCodeGroup.cs
- LoginCancelEventArgs.cs
- CallTemplateAction.cs
- Util.cs
- RowToFieldTransformer.cs
- SafeNativeMethods.cs
- SafeEventLogReadHandle.cs
- ZipIOCentralDirectoryBlock.cs
- ExceptionWrapper.cs
- FilteredSchemaElementLookUpTable.cs
- FrameworkContentElementAutomationPeer.cs
- TypeProvider.cs
- ISAPIApplicationHost.cs
- DerivedKeyCachingSecurityTokenSerializer.cs
- _ConnectOverlappedAsyncResult.cs
- SqlXml.cs
- TimeoutException.cs
- MinMaxParagraphWidth.cs
- System.Data_BID.cs
- ScriptComponentDescriptor.cs
- XmlSerializer.cs
- ServiceObjectContainer.cs
- NullableDoubleAverageAggregationOperator.cs
- SoundPlayer.cs
- Animatable.cs
- TimerEventSubscriptionCollection.cs
- ContainerSelectorActiveEvent.cs
- InplaceBitmapMetadataWriter.cs
- FileDialog_Vista.cs
- UnknownExceptionActionHelper.cs
- AnnotationHelper.cs
- FieldNameLookup.cs
- SqlInternalConnection.cs
- BufferedWebEventProvider.cs
- RtfToXamlLexer.cs
- CommonDialog.cs
- EntityDataSourceColumn.cs
- RadioButtonList.cs
- Emitter.cs
- IODescriptionAttribute.cs
- BindingList.cs
- TrustVersion.cs
- CustomUserNameSecurityTokenAuthenticator.cs
- DPCustomTypeDescriptor.cs
- DbProviderServices.cs
- Span.cs
- DesignerDataParameter.cs
- PageCatalogPart.cs
- DataGridViewCellContextMenuStripNeededEventArgs.cs
- DataException.cs
- BamlResourceContent.cs
- MemberPathMap.cs
- WebPartDisplayModeEventArgs.cs
- OleDbConnectionInternal.cs
- LocationFactory.cs
- HtmlTableCellCollection.cs
- SymDocumentType.cs