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
- XPathNode.cs
- EventToken.cs
- GridViewColumnCollection.cs
- CallbackBehaviorAttribute.cs
- EndpointAddress.cs
- ComplexTypeEmitter.cs
- safex509handles.cs
- iisPickupDirectory.cs
- CrossAppDomainChannel.cs
- FakeModelItemImpl.cs
- ProxyManager.cs
- ProfilePropertySettingsCollection.cs
- SocketInformation.cs
- Rotation3DAnimation.cs
- DataGridViewTextBoxCell.cs
- UpdatePanelControlTrigger.cs
- DataGridViewIntLinkedList.cs
- SqlParameter.cs
- FileDialogPermission.cs
- Label.cs
- CounterSampleCalculator.cs
- AttributeCollection.cs
- PriorityBinding.cs
- DependencyPropertyValueSerializer.cs
- NonPrimarySelectionGlyph.cs
- ComponentChangingEvent.cs
- IdentityValidationException.cs
- oledbmetadatacollectionnames.cs
- CloudCollection.cs
- DialogResultConverter.cs
- Camera.cs
- PackagePart.cs
- Sql8ExpressionRewriter.cs
- XmlAttributeAttribute.cs
- InputScope.cs
- CatalogPartCollection.cs
- UpdatePanelControlTrigger.cs
- AlphabeticalEnumConverter.cs
- elementinformation.cs
- _CacheStreams.cs
- DataTableTypeConverter.cs
- ObjectDataSourceDesigner.cs
- RecognizerStateChangedEventArgs.cs
- ACL.cs
- Mappings.cs
- FixedSOMTable.cs
- X509IssuerSerialKeyIdentifierClause.cs
- URLAttribute.cs
- CallContext.cs
- Accessible.cs
- MdiWindowListItemConverter.cs
- ComponentSerializationService.cs
- Int16AnimationBase.cs
- ObjectSet.cs
- ReaderWriterLock.cs
- SqlServices.cs
- SequentialUshortCollection.cs
- CompositeTypefaceMetrics.cs
- DesignerHost.cs
- sqlstateclientmanager.cs
- LeftCellWrapper.cs
- AlternateViewCollection.cs
- OleDbError.cs
- DataBindingHandlerAttribute.cs
- EditingCommands.cs
- TemplateControlBuildProvider.cs
- XmlSchemaSimpleTypeRestriction.cs
- ResourceProviderFactory.cs
- TimeoutException.cs
- InternalPermissions.cs
- ExpressionVisitor.cs
- NodeInfo.cs
- XXXOnTypeBuilderInstantiation.cs
- NullableIntSumAggregationOperator.cs
- MailAddressCollection.cs
- FixedHighlight.cs
- DynamicObjectAccessor.cs
- CodeBinaryOperatorExpression.cs
- __TransparentProxy.cs
- RichTextBoxConstants.cs
- TextureBrush.cs
- GenericIdentity.cs
- WorkflowIdleBehavior.cs
- XmlArrayItemAttributes.cs
- ScriptResourceInfo.cs
- AssemblyNameUtility.cs
- InputDevice.cs
- _ProxyChain.cs
- precedingquery.cs
- OpCellTreeNode.cs
- Span.cs
- UserControlParser.cs
- ReplyChannel.cs
- BoolExpr.cs
- Journal.cs
- CompilationUnit.cs
- EntityDataSourceValidationException.cs
- MD5HashHelper.cs
- ColumnTypeConverter.cs
- CellCreator.cs