Add resource action. Implement play chart and import resource action.

This commit is contained in:
2023-11-23 00:02:55 +08:00
parent 33c0826f3b
commit ed496859cb
8 changed files with 117 additions and 0 deletions

View File

@@ -0,0 +1,14 @@
using System;
namespace Cryville.Crtr.Browsing.Actions {
public abstract class ResourceAction<T> : IResourceAction<T> {
public abstract string Name { get; }
public abstract int Priority { get; }
public abstract void Invoke(Uri uri, T resource);
public void Invoke(Uri uri, object resource) {
if (resource == null) throw new ArgumentNullException("resource");
if (!(resource is T)) throw new ArgumentException("Mismatched resource type.");
Invoke(uri, (T)resource);
}
}
}