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
- TextDecorationCollection.cs
- DependencyObjectPropertyDescriptor.cs
- ScrollItemProviderWrapper.cs
- FontInfo.cs
- DataGridLinkButton.cs
- BCLDebug.cs
- SamlAdvice.cs
- ToolStripGripRenderEventArgs.cs
- XmlAttribute.cs
- MappingSource.cs
- StyleTypedPropertyAttribute.cs
- EventDriven.cs
- ContentAlignmentEditor.cs
- SecurityRuntime.cs
- TransformerInfo.cs
- DataGridColumnCollection.cs
- MediaContext.cs
- OperationPickerDialog.cs
- PresentationSource.cs
- NamedServiceModelExtensionCollectionElement.cs
- WebResponse.cs
- ParagraphResult.cs
- DataControlImageButton.cs
- ToolStripSeparatorRenderEventArgs.cs
- SerialPort.cs
- Property.cs
- FastEncoderWindow.cs
- DeflateStreamAsyncResult.cs
- _SSPISessionCache.cs
- CodeCastExpression.cs
- IdentityHolder.cs
- WebPartAuthorizationEventArgs.cs
- JoinGraph.cs
- RegistrationServices.cs
- DataGridViewCheckBoxCell.cs
- LinqDataSourceHelper.cs
- ZipPackage.cs
- ScriptResourceHandler.cs
- SafeBitVector32.cs
- DeferredReference.cs
- WSDualHttpBinding.cs
- MethodImplAttribute.cs
- DataSourceXmlClassAttribute.cs
- DataGridViewCell.cs
- UpdateExpressionVisitor.cs
- SymbolType.cs
- ValidatingReaderNodeData.cs
- _ContextAwareResult.cs
- _ChunkParse.cs
- SQlBooleanStorage.cs
- DbMetaDataCollectionNames.cs
- baseaxisquery.cs
- UrlAuthFailedErrorFormatter.cs
- SqlTypesSchemaImporter.cs
- thaishape.cs
- PersonalizationStateQuery.cs
- CompositeFontFamily.cs
- Speller.cs
- ComplexBindingPropertiesAttribute.cs
- ConfigurationPropertyCollection.cs
- MonitoringDescriptionAttribute.cs
- TypeReference.cs
- Cloud.cs
- RowSpanVector.cs
- EntitySet.cs
- ColorAnimation.cs
- ContainerFilterService.cs
- ButtonStandardAdapter.cs
- DBDataPermission.cs
- SerializationException.cs
- Permission.cs
- MsmqIntegrationSecurityElement.cs
- webeventbuffer.cs
- AuthenticationModulesSection.cs
- ISAPIWorkerRequest.cs
- ReliableMessagingVersion.cs
- UpDownEvent.cs
- MethodToken.cs
- HandlerFactoryCache.cs
- HandlerFactoryCache.cs
- XPathConvert.cs
- StringFormat.cs
- IntermediatePolicyValidator.cs
- Wildcard.cs
- InternalDispatchObject.cs
- SafeNativeMemoryHandle.cs
- CannotUnloadAppDomainException.cs
- SpecialTypeDataContract.cs
- NetworkAddressChange.cs
- CommonProperties.cs
- QilLoop.cs
- Transform3DGroup.cs
- RuleSettingsCollection.cs
- InputReportEventArgs.cs
- Environment.cs
- MULTI_QI.cs
- Lookup.cs
- DataListItemCollection.cs
- SelectionHighlightInfo.cs
- PropertyManager.cs