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
- FlowDocumentPaginator.cs
- StylusPlugin.cs
- RecognizedPhrase.cs
- AccessDataSource.cs
- UpdatePanelControlTrigger.cs
- TextSerializer.cs
- GridViewDeletedEventArgs.cs
- SqlTransaction.cs
- FastEncoderWindow.cs
- EventLogPermission.cs
- HelpInfo.cs
- InvalidMessageContractException.cs
- TableParagraph.cs
- ProfileSettingsCollection.cs
- RowUpdatedEventArgs.cs
- MultiTrigger.cs
- RoutedEventArgs.cs
- KnownColorTable.cs
- EncryptedKey.cs
- ListItemCollection.cs
- DataGridViewTopRowAccessibleObject.cs
- ObjectHandle.cs
- WebBrowserNavigatedEventHandler.cs
- XPathNodeIterator.cs
- ProxyElement.cs
- MenuItem.cs
- TrustManager.cs
- XPathAncestorIterator.cs
- FileDialog.cs
- Rijndael.cs
- EditorZone.cs
- GifBitmapDecoder.cs
- ToolTip.cs
- ViewManager.cs
- sqlser.cs
- CallContext.cs
- UshortList2.cs
- CacheModeConverter.cs
- ProviderSettingsCollection.cs
- UsernameTokenFactoryCredential.cs
- DefaultAssemblyResolver.cs
- WindowsTokenRoleProvider.cs
- LayoutTableCell.cs
- FactoryRecord.cs
- SQLByteStorage.cs
- CrossContextChannel.cs
- FormViewCommandEventArgs.cs
- EtwTrackingBehavior.cs
- WindowsIdentity.cs
- Line.cs
- BulletedListEventArgs.cs
- ChildrenQuery.cs
- StorageRoot.cs
- SendKeys.cs
- NavigationCommands.cs
- WebEventCodes.cs
- StrokeNodeOperations2.cs
- InvalidOleVariantTypeException.cs
- AsyncCompletedEventArgs.cs
- Signature.cs
- MimeReturn.cs
- HttpDigestClientCredential.cs
- RoutedCommand.cs
- PtsCache.cs
- ContextDataSourceView.cs
- BaseTransportHeaders.cs
- WindowsClaimSet.cs
- WindowsTokenRoleProvider.cs
- ResourceAssociationSetEnd.cs
- DefaultShape.cs
- XmlWhitespace.cs
- FlowPosition.cs
- HideDisabledControlAdapter.cs
- BStrWrapper.cs
- AggregateNode.cs
- PlatformNotSupportedException.cs
- TimeoutException.cs
- nulltextnavigator.cs
- QilInvoke.cs
- LineServicesCallbacks.cs
- StoreContentChangedEventArgs.cs
- SettingsAttributeDictionary.cs
- InternalBufferOverflowException.cs
- HttpException.cs
- CroppedBitmap.cs
- OperationCanceledException.cs
- XmlSchemaComplexType.cs
- Rss20FeedFormatter.cs
- Tile.cs
- HijriCalendar.cs
- SevenBitStream.cs
- OdbcTransaction.cs
- PointCollectionValueSerializer.cs
- SourceSwitch.cs
- OdbcHandle.cs
- PEFileReader.cs
- AssociationSetMetadata.cs
- Expr.cs
- XmlCharCheckingWriter.cs
- PropertyKey.cs