Code:
/ DotNET / DotNET / 8.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
- ArrayEditor.cs
- ScrollViewerAutomationPeer.cs
- Script.cs
- CaseStatementSlot.cs
- DependencyPropertyHelper.cs
- PasswordRecovery.cs
- PtsCache.cs
- DateTimeValueSerializerContext.cs
- PenCursorManager.cs
- EntityContainerRelationshipSetEnd.cs
- BitmapEffectInputData.cs
- XmlDocument.cs
- ScopelessEnumAttribute.cs
- AttachedPropertyBrowsableAttribute.cs
- BitConverter.cs
- _DigestClient.cs
- DataObjectMethodAttribute.cs
- BamlResourceSerializer.cs
- UnsafeNativeMethodsTablet.cs
- XmlSchemaInfo.cs
- UIAgentInitializationException.cs
- AttachedPropertyBrowsableForTypeAttribute.cs
- WorkflowServiceHostFactory.cs
- RepeaterItemEventArgs.cs
- GroupBox.cs
- ButtonRenderer.cs
- CompositionCommandSet.cs
- FileClassifier.cs
- TextContainerHelper.cs
- XDeferredAxisSource.cs
- ImportedNamespaceContextItem.cs
- HtmlShimManager.cs
- FloaterParagraph.cs
- UnrecognizedPolicyAssertionElement.cs
- ISFClipboardData.cs
- HtmlUtf8RawTextWriter.cs
- NavigationHelper.cs
- FreeFormDragDropManager.cs
- Accessible.cs
- RoutedEventArgs.cs
- BasicExpressionVisitor.cs
- SrgsText.cs
- Rotation3D.cs
- PointHitTestParameters.cs
- ComponentChangedEvent.cs
- CodeSnippetTypeMember.cs
- SpecularMaterial.cs
- BridgeDataRecord.cs
- InstallHelper.cs
- WinEventWrap.cs
- ParserStreamGeometryContext.cs
- Transform3DGroup.cs
- SpecularMaterial.cs
- Types.cs
- ElementsClipboardData.cs
- CacheChildrenQuery.cs
- ScriptComponentDescriptor.cs
- CqlParserHelpers.cs
- OciLobLocator.cs
- DSASignatureDeformatter.cs
- ControlBindingsConverter.cs
- PackagePart.cs
- SchemaElementDecl.cs
- WsdlWriter.cs
- DBNull.cs
- Path.cs
- MouseEvent.cs
- ResourcesBuildProvider.cs
- NodeLabelEditEvent.cs
- TimeSpanValidatorAttribute.cs
- TemplatedMailWebEventProvider.cs
- EmptyCollection.cs
- PrefixQName.cs
- NamespaceInfo.cs
- ConfigurationStrings.cs
- Simplifier.cs
- TextEditorParagraphs.cs
- DataBoundControlAdapter.cs
- ZipQueryOperator.cs
- ScaleTransform.cs
- updateconfighost.cs
- DataSetSchema.cs
- MimeMapping.cs
- BufferModeSettings.cs
- TransportDefaults.cs
- XamlSerializerUtil.cs
- Win32SafeHandles.cs
- KeySpline.cs
- TextServicesManager.cs
- EndpointConfigContainer.cs
- SqlStatistics.cs
- ClassData.cs
- coordinatorscratchpad.cs
- StreamAsIStream.cs
- OptimizedTemplateContent.cs
- SafeCertificateContext.cs
- TrackingMemoryStream.cs
- IriParsingElement.cs
- DataGridViewAutoSizeColumnModeEventArgs.cs
- ParseChildrenAsPropertiesAttribute.cs