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
- InstalledFontCollection.cs
- StringAnimationBase.cs
- SecurityTokenProvider.cs
- UrlMapping.cs
- XmlSchemaAnnotated.cs
- FileStream.cs
- EventLogSession.cs
- EditingScopeUndoUnit.cs
- OleDbWrapper.cs
- DataControlImageButton.cs
- UniformGrid.cs
- MultidimensionalArrayItemReference.cs
- IEnumerable.cs
- TextViewBase.cs
- TextServicesDisplayAttributePropertyRanges.cs
- Brushes.cs
- Floater.cs
- TransformerInfoCollection.cs
- BoundColumn.cs
- CompilationAssemblyInstallComponent.cs
- ObjectItemCollection.cs
- XsltInput.cs
- DragStartedEventArgs.cs
- FileInfo.cs
- FocusTracker.cs
- QilFunction.cs
- CustomWebEventKey.cs
- PropertyBuilder.cs
- QilIterator.cs
- FixedNode.cs
- DataGridCell.cs
- Rfc2898DeriveBytes.cs
- RestHandlerFactory.cs
- DockPatternIdentifiers.cs
- ImpersonateTokenRef.cs
- Marshal.cs
- SmiEventSink_Default.cs
- DeviceContext2.cs
- IODescriptionAttribute.cs
- HttpProtocolImporter.cs
- ImageAttributes.cs
- FormViewModeEventArgs.cs
- ComplexType.cs
- IImplicitResourceProvider.cs
- HostUtils.cs
- X509ChainPolicy.cs
- CacheVirtualItemsEvent.cs
- Visual.cs
- XmlStringTable.cs
- Binding.cs
- BaseAsyncResult.cs
- EnvelopedPkcs7.cs
- FieldToken.cs
- FormViewDeletedEventArgs.cs
- HandlerFactoryWrapper.cs
- DNS.cs
- DependencyPropertyKind.cs
- StylusSystemGestureEventArgs.cs
- TakeQueryOptionExpression.cs
- Win32NamedPipes.cs
- MethodMessage.cs
- SqlParameterizer.cs
- CfgParser.cs
- mediaclock.cs
- XmlSchemaInferenceException.cs
- StorageConditionPropertyMapping.cs
- ValueQuery.cs
- COM2Enum.cs
- PropertyAccessVisitor.cs
- LinkLabelLinkClickedEvent.cs
- PackWebRequest.cs
- ScriptControlDescriptor.cs
- HttpNamespaceReservationInstallComponent.cs
- TargetFrameworkUtil.cs
- WindowsStartMenu.cs
- FileNotFoundException.cs
- CommandBinding.cs
- ConfigurationLocationCollection.cs
- FixedSchema.cs
- ObjectDataSourceFilteringEventArgs.cs
- DataGridViewCell.cs
- MarkupCompiler.cs
- FrameworkElementAutomationPeer.cs
- MemoryMappedFileSecurity.cs
- SqlNode.cs
- RawStylusInputCustomDataList.cs
- EventlogProvider.cs
- Char.cs
- XmlNodeList.cs
- PolicyLevel.cs
- DragDrop.cs
- IndentedWriter.cs
- RsaSecurityTokenAuthenticator.cs
- CompositeActivityCodeGenerator.cs
- Peer.cs
- Int32.cs
- UpdatableGenericsFeature.cs
- HtmlShimManager.cs
- TypeHelpers.cs
- CancelEventArgs.cs