Code:
/ FX-1434 / FX-1434 / 1.0 / untmp / whidbey / REDBITS / ndp / fx / src / Designer / Host / TypeDescriptorFilterService.cs / 1 / TypeDescriptorFilterService.cs
//------------------------------------------------------------------------------ //// Copyright (c) Microsoft Corporation. All rights reserved. // //----------------------------------------------------------------------------- namespace System.ComponentModel.Design { using System; using System.Collections; using System.ComponentModel; using System.ComponentModel.Design; ////// This service is requested by TypeDescriptor when asking for type information /// for a component. Our implementation forwards this filter onto IDesignerFilter /// on the component's designer, should one exist. /// internal sealed class TypeDescriptorFilterService : ITypeDescriptorFilterService { ////// Internal ctor to prevent semitrust from creating us. /// internal TypeDescriptorFilterService() { } ////// Helper method to return the designer for a given component. /// private IDesigner GetDesigner(IComponent component) { ISite site = component.Site; if (site != null) { IDesignerHost host = site.GetService(typeof(IDesignerHost)) as IDesignerHost; if (host != null) { return host.GetDesigner(component); } } return null; } ////// bool ITypeDescriptorFilterService.FilterAttributes(IComponent component, IDictionary attributes) { if (component == null) { throw new ArgumentNullException("component"); } if (attributes == null) { throw new ArgumentNullException("attributes"); } IDesigner designer = GetDesigner(component); if (designer is IDesignerFilter) { ((IDesignerFilter)designer).PreFilterAttributes(attributes); ((IDesignerFilter)designer).PostFilterAttributes(attributes); } return designer != null; } ////// Provides a way to filter the attributes from a component that are displayed to the user. /// ////// bool ITypeDescriptorFilterService.FilterEvents(IComponent component, IDictionary events) { if (component == null) { throw new ArgumentNullException("component"); } if (events == null) { throw new ArgumentNullException("events"); } IDesigner designer = GetDesigner(component); if (designer is IDesignerFilter) { ((IDesignerFilter)designer).PreFilterEvents(events); ((IDesignerFilter)designer).PostFilterEvents(events); } return designer != null; } ////// Provides a way to filter the events from a component that are displayed to the user. /// ////// bool ITypeDescriptorFilterService.FilterProperties(IComponent component, IDictionary properties) { if (component == null) { throw new ArgumentNullException("component"); } if (properties == null) { throw new ArgumentNullException("properties"); } IDesigner designer = GetDesigner(component); if (designer is IDesignerFilter) { ((IDesignerFilter)designer).PreFilterProperties(properties); ((IDesignerFilter)designer).PostFilterProperties(properties); } return designer != null; } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. // Copyright (c) Microsoft Corporation. All rights reserved./// Provides a way to filter the properties from a component that are displayed to the user. /// ///
Link Menu
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- Base64Stream.cs
- HwndSource.cs
- PermissionSetEnumerator.cs
- WindowsListViewScroll.cs
- GraphicsState.cs
- DataBindingCollectionConverter.cs
- KeyGestureValueSerializer.cs
- XPathItem.cs
- XmlNotation.cs
- ObjectDataSourceMethodEventArgs.cs
- ObjectDataSourceDisposingEventArgs.cs
- DataMisalignedException.cs
- ContentTextAutomationPeer.cs
- BooleanKeyFrameCollection.cs
- ImageCodecInfo.cs
- GridItem.cs
- BamlLocalizableResource.cs
- GeometryGroup.cs
- XmlDataSourceView.cs
- ScriptBehaviorDescriptor.cs
- VBIdentifierDesigner.xaml.cs
- ExpressionDumper.cs
- ServiceBusyException.cs
- CodeAccessPermission.cs
- ComponentDispatcher.cs
- ThemeDirectoryCompiler.cs
- WindowsEditBox.cs
- ObjectCloneHelper.cs
- PixelShader.cs
- RegisteredHiddenField.cs
- NumberFormatter.cs
- DocumentApplicationJournalEntry.cs
- LoadRetryHandler.cs
- AppDomainFactory.cs
- UnicodeEncoding.cs
- IriParsingElement.cs
- CompiledELinqQueryState.cs
- HtmlLink.cs
- ShaderEffect.cs
- rsa.cs
- ConstructorBuilder.cs
- updatecommandorderer.cs
- Lease.cs
- ToolStripDropDown.cs
- Win32Native.cs
- WindowsPrincipal.cs
- ObfuscationAttribute.cs
- ClickablePoint.cs
- odbcmetadatafactory.cs
- BitmapCodecInfo.cs
- ElementHost.cs
- XmlSchemaExporter.cs
- StylusPointPropertyInfo.cs
- FrameworkElement.cs
- DataSourceIDConverter.cs
- WebPartDisplayModeCancelEventArgs.cs
- DependentList.cs
- DataBoundControl.cs
- RelationshipSet.cs
- SqlIdentifier.cs
- XmlSchemaAnyAttribute.cs
- ListComponentEditor.cs
- ExplicitDiscriminatorMap.cs
- LoadRetryHandler.cs
- BrowserInteropHelper.cs
- DataList.cs
- BitmapImage.cs
- filewebrequest.cs
- OraclePermission.cs
- CustomSignedXml.cs
- _BasicClient.cs
- NotifyIcon.cs
- Transform.cs
- BinaryObjectInfo.cs
- ApplicationException.cs
- TableLayout.cs
- FixedDocumentSequencePaginator.cs
- Metafile.cs
- XmlSchemaValidationException.cs
- SafeEventHandle.cs
- EmptyWithCancelationCheckWorkItem.cs
- LoadGrammarCompletedEventArgs.cs
- ResourceDisplayNameAttribute.cs
- ToolZone.cs
- TdsParserStaticMethods.cs
- LassoHelper.cs
- XmlDataDocument.cs
- DrawingBrush.cs
- ExpressionBindingsDialog.cs
- RequestQueryProcessor.cs
- SetMemberBinder.cs
- ControlBindingsCollection.cs
- DependencyPropertyValueSerializer.cs
- StartUpEventArgs.cs
- PerspectiveCamera.cs
- HttpCookiesSection.cs
- WebPartExportVerb.cs
- AnnotationResourceCollection.cs
- EDesignUtil.cs
- DependencyStoreSurrogate.cs