You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
49 lines
1.5 KiB
49 lines
1.5 KiB
// <file> |
|
// <copyright see="prj:///doc/copyright.txt"/> |
|
// <license see="prj:///doc/license.txt"/> |
|
// <owner name="Christian Hornung" email="c-hornung@gmx.de"/> |
|
// <version>$Revision$</version> |
|
// </file> |
|
|
|
using System; |
|
using System.Collections.Generic; |
|
|
|
using ICSharpCode.Core; |
|
|
|
using Hornung.ResourceToolkit.Resolver; |
|
|
|
namespace Hornung.ResourceToolkit.Gui |
|
{ |
|
/// <summary> |
|
/// Hides or shows the ICSharpCode.Core host resources in an UnusedResourceKeysViewContent. |
|
/// </summary> |
|
public class UnusedResourceKeysHideICSharpCodeCoreHostResourcesCommand : AbstractCheckableMenuCommand, IFilter<ResourceItem> |
|
{ |
|
string icSharpCodeCoreHostResourceFileName; |
|
|
|
public override void Run() |
|
{ |
|
base.Run(); |
|
|
|
IFilterHost<ResourceItem> host = ((ToolBarCheckBox)this.Owner).Caller as IFilterHost<ResourceItem>; |
|
if (host != null) { |
|
if (this.IsChecked) { |
|
this.icSharpCodeCoreHostResourceFileName = ICSharpCodeCoreResourceResolver.GetICSharpCodeCoreHostResourceFileName(null); |
|
host.RegisterFilter(this); |
|
} else { |
|
host.UnregisterFilter(this); |
|
} |
|
} |
|
} |
|
|
|
/// <summary> |
|
/// Determines if the specified item matches the current filter criteria. |
|
/// </summary> |
|
/// <param name="item">The item to test.</param> |
|
/// <returns><c>true</c>, if the specified item matches the current filter criteria, otherwise <c>false</c>.</returns> |
|
public bool IsMatch(ResourceItem item) |
|
{ |
|
return !FileUtility.IsEqualFileName(item.FileName, this.icSharpCodeCoreHostResourceFileName); |
|
} |
|
} |
|
}
|
|
|