/// /// Copyright © 2003-2008 JetBrains s.r.o. /// You may distribute under the terms of the GNU General Public License, as published by the Free Software Foundation, version 2 (see License.txt in the repository root folder). /// using System.Collections; using JetBrains.Omea.OpenAPI; namespace JetBrains.Omea { /// /// A composition of several links pane filters. /// internal class CompositeLinksPaneFilter: ILinksPaneFilter { private ArrayList _baseFilters; public CompositeLinksPaneFilter( params ILinksPaneFilter[] filters ) { _baseFilters = new ArrayList( filters ); } public void AddBaseFilter( ILinksPaneFilter filter ) { _baseFilters.Add( filter ); } public bool AcceptLinkType( IResource displayedResource, int propId, ref string displayName ) { foreach( ILinksPaneFilter filter in _baseFilters ) { if ( !filter.AcceptLinkType( displayedResource, propId, ref displayName ) ) return false; } return true; } public bool AcceptLink( IResource displayedResource, int propId, IResource targetResource, ref string linkTooltip ) { foreach( ILinksPaneFilter filter in _baseFilters ) { if ( !filter.AcceptLink( displayedResource, propId, targetResource, ref linkTooltip ) ) return false; } return true; } public bool AcceptAction( IResource displayedResource, IAction action ) { foreach( ILinksPaneFilter filter in _baseFilters ) { if ( !filter.AcceptAction( displayedResource, action ) ) return false; } return true; } } }