Restructure resource managers. Add remove resource interface and directory changed event.

This commit is contained in:
2023-11-23 00:01:29 +08:00
parent 2d7a204a30
commit 33c0826f3b
2 changed files with 39 additions and 70 deletions

View File

@@ -2,10 +2,17 @@ using System;
using System.Collections.Generic;
namespace Cryville.Crtr.Browsing {
public interface IResourceManager<T> : IReadOnlyList<T> {
Uri GetItemUri(int id);
public interface IResourceManager {
int Count { get; }
object this[int index] { get; }
Uri GetItemUri(int index);
event Action ItemChanged;
bool IsReadOnly { get; }
bool ImportFrom(Uri uri);
void RemoveAt(int index);
bool ImportItemFrom(Uri uri);
[Obsolete]
string[] GetSupportedFormats();
[Obsolete]
@@ -13,13 +20,15 @@ namespace Cryville.Crtr.Browsing {
void Activate();
void Deactivate();
event Action ItemChanged;
}
public interface IResourceManager<T> : IResourceManager {
new T this[int index] { get; }
}
public interface IPathedResourceManager<T> : IResourceManager<T> {
string[] CurrentDirectory { get; }
void ChangeDirectory(string[] dir);
void OpenDirectory(int id);
event Action DirectoryChanged;
IList<string> CurrentDirectory { get; }
void ChangeDirectory(IEnumerable<string> dir);
void OpenDirectory(int index);
void ReturnToDirectory(int index);
}
}