Add CanInvoke
method to IResourceAction
.
This commit is contained in:
@@ -4,6 +4,14 @@ namespace Cryville.Crtr.Browsing.Actions {
|
||||
public abstract class ResourceAction<T> : IResourceAction<T> where T : IResourceMeta {
|
||||
public abstract string Name { get; }
|
||||
public abstract int Priority { get; }
|
||||
|
||||
public abstract bool CanInvoke(Uri uri, T resource);
|
||||
public bool CanInvoke(Uri uri, IResourceMeta resource) {
|
||||
if (resource == null) throw new ArgumentNullException("resource");
|
||||
if (!(resource is T)) throw new ArgumentException("Mismatched resource type.");
|
||||
return CanInvoke(uri, (T)resource);
|
||||
}
|
||||
|
||||
public abstract void Invoke(Uri uri, T resource);
|
||||
public void Invoke(Uri uri, IResourceMeta resource) {
|
||||
if (resource == null) throw new ArgumentNullException("resource");
|
||||
|
Reference in New Issue
Block a user