Refactor folder structure
This commit is contained in:
49
src/Editor/Ghost.Editor.Core/Contracts/IAssetRegistry.cs
Normal file
49
src/Editor/Ghost.Editor.Core/Contracts/IAssetRegistry.cs
Normal file
@@ -0,0 +1,49 @@
|
||||
using Ghost.Core;
|
||||
using Ghost.Editor.Core.AssetHandler;
|
||||
|
||||
namespace Ghost.Editor.Core.Contracts;
|
||||
|
||||
public enum AssetChangeType
|
||||
{
|
||||
None = 0,
|
||||
Created,
|
||||
Deleted,
|
||||
Modified,
|
||||
Renamed,
|
||||
}
|
||||
|
||||
public sealed class AssetChangedEventArgs : EventArgs
|
||||
{
|
||||
public string AssetPath
|
||||
{
|
||||
get;
|
||||
}
|
||||
|
||||
public string? OldAssetPath
|
||||
{
|
||||
get;
|
||||
}
|
||||
|
||||
public AssetChangeType ChangeType
|
||||
{
|
||||
get;
|
||||
}
|
||||
|
||||
internal AssetChangedEventArgs(string assetPath, string? oldAssetPath, AssetChangeType changeType)
|
||||
{
|
||||
AssetPath = assetPath;
|
||||
OldAssetPath = oldAssetPath;
|
||||
ChangeType = changeType;
|
||||
}
|
||||
}
|
||||
|
||||
public interface IAssetRegistry : IDisposable
|
||||
{
|
||||
string? GetAssetPath(Guid id);
|
||||
Guid GetAssetGuid(string assetPath);
|
||||
|
||||
ValueTask<Result<Guid>> ImportAssetAsync(string sourceFilePath, string targetAssetPath, CancellationToken token = default);
|
||||
ValueTask<Result> ReimportAssetAsync(Guid assetId, string sourceFilePath, CancellationToken token = default);
|
||||
ValueTask<Result<Asset>> LoadAssetAsync(Guid id, CancellationToken token = default);
|
||||
ValueTask<Result> SaveAssetAsync(Asset asset, CancellationToken token = default);
|
||||
}
|
||||
13
src/Editor/Ghost.Editor.Core/Contracts/IInspectable.cs
Normal file
13
src/Editor/Ghost.Editor.Core/Contracts/IInspectable.cs
Normal file
@@ -0,0 +1,13 @@
|
||||
using Microsoft.UI.Xaml;
|
||||
using Microsoft.UI.Xaml.Controls;
|
||||
|
||||
namespace Ghost.Editor.Core.Contracts;
|
||||
|
||||
public interface IInspectable
|
||||
{
|
||||
public IconSource? CreateIcon();
|
||||
|
||||
public UIElement? CreateHeader();
|
||||
|
||||
public UIElement? CreateInspector();
|
||||
}
|
||||
32
src/Editor/Ghost.Editor.Core/Contracts/IInspectorService.cs
Normal file
32
src/Editor/Ghost.Editor.Core/Contracts/IInspectorService.cs
Normal file
@@ -0,0 +1,32 @@
|
||||
namespace Ghost.Editor.Core.Contracts;
|
||||
|
||||
public class InspectorSelectionChangedEventArgs : EventArgs
|
||||
{
|
||||
public object? Source
|
||||
{
|
||||
get;
|
||||
}
|
||||
|
||||
public IInspectable? Selected
|
||||
{
|
||||
get;
|
||||
}
|
||||
|
||||
public InspectorSelectionChangedEventArgs(object? source, IInspectable? selected)
|
||||
{
|
||||
Source = source;
|
||||
Selected = selected;
|
||||
}
|
||||
}
|
||||
|
||||
public interface IInspectorService
|
||||
{
|
||||
IInspectable? Selected
|
||||
{
|
||||
get;
|
||||
}
|
||||
|
||||
event EventHandler<InspectorSelectionChangedEventArgs> OnSelectionChanged;
|
||||
|
||||
void SetSelected(IInspectable? inspectable, object? source);
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
namespace Ghost.Editor.Core.Contracts;
|
||||
|
||||
public interface INavigationAware
|
||||
{
|
||||
public void OnNavigatedTo(object? parameter);
|
||||
public void OnNavigatedFrom();
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
using CommunityToolkit.WinUI.Behaviors;
|
||||
using Ghost.Editor.Core.Notifications;
|
||||
|
||||
namespace Ghost.Editor.Core.Contracts;
|
||||
|
||||
public interface INotificationService
|
||||
{
|
||||
public void ShowNotification(string? message, MessageType type, int duration = 5, string? title = null);
|
||||
public void ShowNotification(Notification notification);
|
||||
}
|
||||
12
src/Editor/Ghost.Editor.Core/Contracts/IPreviewService.cs
Normal file
12
src/Editor/Ghost.Editor.Core/Contracts/IPreviewService.cs
Normal file
@@ -0,0 +1,12 @@
|
||||
namespace Ghost.Editor.Core.Contracts;
|
||||
|
||||
public enum IconSize
|
||||
{
|
||||
Small,
|
||||
Large
|
||||
}
|
||||
|
||||
public interface IPreviewService
|
||||
{
|
||||
string GetIconPath(string path, bool isDirectory, IconSize size);
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
namespace Ghost.Editor.Core.Contracts;
|
||||
|
||||
public interface IProgressService
|
||||
{
|
||||
public void ShowProgress(string message, double progress = 0.0);
|
||||
public void ShowIndeterminateProgress(string message);
|
||||
public void SetProgress(double progress);
|
||||
public void HideProgress();
|
||||
}
|
||||
Reference in New Issue
Block a user