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
- DataBoundControlAdapter.cs
- DoubleUtil.cs
- ManagedIStream.cs
- XmlSchemaExternal.cs
- DataGridItem.cs
- DocumentViewer.cs
- StylusPointDescription.cs
- Transform3DGroup.cs
- CSharpCodeProvider.cs
- HttpHandlerActionCollection.cs
- PackageRelationship.cs
- DictionaryBase.cs
- WebServiceTypeData.cs
- RegistryKey.cs
- EmbossBitmapEffect.cs
- GeneralTransform3D.cs
- DataSourceViewSchemaConverter.cs
- MemberJoinTreeNode.cs
- CancellationHandler.cs
- WsatTransactionFormatter.cs
- PageThemeParser.cs
- TemplatedMailWebEventProvider.cs
- PropertyDescriptorComparer.cs
- FormsAuthenticationConfiguration.cs
- XMLSyntaxException.cs
- IndexedString.cs
- COM2FontConverter.cs
- SqlExpander.cs
- SupportsEventValidationAttribute.cs
- SqlConnectionStringBuilder.cs
- Intellisense.cs
- SoapParser.cs
- LineSegment.cs
- ContentPosition.cs
- TextElementEnumerator.cs
- DecimalAnimationUsingKeyFrames.cs
- WindowsListViewGroupHelper.cs
- ListChunk.cs
- CircleHotSpot.cs
- PassportPrincipal.cs
- PanelStyle.cs
- Module.cs
- SystemParameters.cs
- DeclarationUpdate.cs
- Byte.cs
- WindowsStartMenu.cs
- LinearGradientBrush.cs
- ErrorTableItemStyle.cs
- rsa.cs
- Exceptions.cs
- DesignerCommandAdapter.cs
- PersonalizablePropertyEntry.cs
- KeyManager.cs
- ToolStripDesignerAvailabilityAttribute.cs
- validationstate.cs
- LinqDataSourceInsertEventArgs.cs
- DragDropHelper.cs
- FormattedText.cs
- BookmarkWorkItem.cs
- DefaultPropertiesToSend.cs
- WebPartRestoreVerb.cs
- DataGridCheckBoxColumn.cs
- Inflater.cs
- MapPathBasedVirtualPathProvider.cs
- RemotingServices.cs
- ReferenceConverter.cs
- ProjectionPruner.cs
- XmlNotation.cs
- DataGridViewCellToolTipTextNeededEventArgs.cs
- KerberosSecurityTokenAuthenticator.cs
- SoapFormatterSinks.cs
- CollectionBuilder.cs
- EventData.cs
- EventLogPermissionHolder.cs
- OleDbTransaction.cs
- FocusTracker.cs
- VisualStyleElement.cs
- ErrorRuntimeConfig.cs
- SQLConvert.cs
- sqlinternaltransaction.cs
- CellTreeNodeVisitors.cs
- KeyGestureValueSerializer.cs
- TrackBar.cs
- NetworkInformationPermission.cs
- SimpleLine.cs
- RegexTree.cs
- ItemsControlAutomationPeer.cs
- HtmlInputImage.cs
- AssemblyInfo.cs
- TraceUtility.cs
- TreeViewImageKeyConverter.cs
- BindableAttribute.cs
- SafeBitVector32.cs
- InstancePersistenceException.cs
- ApplicationBuildProvider.cs
- CodeSnippetStatement.cs
- AttachedPropertyDescriptor.cs
- DataServiceResponse.cs
- XmlSortKey.cs
- BitmapEncoder.cs