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
- DependencyPropertyValueSerializer.cs
- SchemaCollectionCompiler.cs
- httpstaticobjectscollection.cs
- TextServicesManager.cs
- TdsValueSetter.cs
- PolyLineSegmentFigureLogic.cs
- TypeUtils.cs
- SourceSwitch.cs
- NullExtension.cs
- Helper.cs
- TablePatternIdentifiers.cs
- HtmlControl.cs
- ContentPresenter.cs
- IdnElement.cs
- ExtendLockAsyncResult.cs
- RuntimeCompatibilityAttribute.cs
- CodeActivityMetadata.cs
- ToolStripSplitButton.cs
- ProtocolViolationException.cs
- EntityDataSourceSelectingEventArgs.cs
- MailMessageEventArgs.cs
- PrivilegedConfigurationManager.cs
- CapabilitiesPattern.cs
- PropagatorResult.cs
- XPathDocumentBuilder.cs
- UDPClient.cs
- WindowsFormsDesignerOptionService.cs
- DrawingGroup.cs
- MaskInputRejectedEventArgs.cs
- IntSecurity.cs
- SamlSubject.cs
- ManualResetEvent.cs
- ErrorActivity.cs
- ProfilePropertyMetadata.cs
- IpcChannel.cs
- SecurityPermission.cs
- SynchronizationFilter.cs
- Stroke2.cs
- DynamicResourceExtensionConverter.cs
- SchemaTableColumn.cs
- EntityDataSourceReferenceGroup.cs
- DataGridViewTextBoxCell.cs
- DocumentViewer.cs
- VideoDrawing.cs
- ResourceReader.cs
- EntityDataSourceDesigner.cs
- CollectionBuilder.cs
- GetParentChain.cs
- DecoderExceptionFallback.cs
- BuildProviderInstallComponent.cs
- OleDbInfoMessageEvent.cs
- diagnosticsswitches.cs
- XmlSchemaSimpleContentRestriction.cs
- PowerStatus.cs
- Crypto.cs
- TrackingServices.cs
- CustomTypeDescriptor.cs
- Helper.cs
- CatalogZoneBase.cs
- RectangleHotSpot.cs
- SrgsOneOf.cs
- XmlSchemaAnnotation.cs
- GroupBox.cs
- Calendar.cs
- SvcFileManager.cs
- RC2.cs
- PerformanceCounterPermissionEntry.cs
- safelinkcollection.cs
- UniqueID.cs
- IPEndPointCollection.cs
- WebEvents.cs
- CompilationLock.cs
- OpacityConverter.cs
- WizardStepBase.cs
- ScriptRegistrationManager.cs
- DataSourceCacheDurationConverter.cs
- DesignerView.xaml.cs
- CodeAttributeArgumentCollection.cs
- PartitionResolver.cs
- SqlCommand.cs
- COM2IDispatchConverter.cs
- DefaultProfileManager.cs
- ArrangedElement.cs
- PasswordDeriveBytes.cs
- controlskin.cs
- MemberProjectedSlot.cs
- SecUtil.cs
- UnsafeNativeMethods.cs
- ConfigurationLocation.cs
- TextBlockAutomationPeer.cs
- PartialCachingAttribute.cs
- RoleGroup.cs
- InstanceData.cs
- PriorityChain.cs
- SelectionPattern.cs
- MediaPlayerState.cs
- LocalizationParserHooks.cs
- PropertyOrder.cs
- Mappings.cs
- RegexCode.cs