Добавьте файлы проекта.
This commit is contained in:
38
SQLVision.Core/Interfaces/IScriptManager.cs
Normal file
38
SQLVision.Core/Interfaces/IScriptManager.cs
Normal file
@@ -0,0 +1,38 @@
|
||||
using SQLVision.Core.Enums;
|
||||
using SQLVision.Core.Models;
|
||||
|
||||
namespace SQLVision.Core.Interfaces;
|
||||
|
||||
public interface IScriptManager
|
||||
{
|
||||
Task<IEnumerable<ScriptMetadata>> LoadScriptsAsync(string? directory = null);
|
||||
Task<ScriptMetadata> ReloadScriptAsync(string filePath);
|
||||
void WatchDirectory(string directory, Action<string> onScriptChanged);
|
||||
|
||||
event EventHandler<ScriptChangedEventArgs> ScriptChanged;
|
||||
event EventHandler<ScriptsReloadedEventArgs> ScriptsReloaded;
|
||||
}
|
||||
|
||||
public class ScriptChangedEventArgs : EventArgs
|
||||
{
|
||||
public string FilePath { get; }
|
||||
public ScriptChangeType ChangeType { get; }
|
||||
public ScriptMetadata? Script { get; }
|
||||
|
||||
public ScriptChangedEventArgs(string filePath, ScriptChangeType changeType, ScriptMetadata? script = null)
|
||||
{
|
||||
FilePath = filePath;
|
||||
ChangeType = changeType;
|
||||
Script = script;
|
||||
}
|
||||
}
|
||||
|
||||
public class ScriptsReloadedEventArgs : EventArgs
|
||||
{
|
||||
public IEnumerable<ScriptMetadata> Scripts { get; }
|
||||
|
||||
public ScriptsReloadedEventArgs(IEnumerable<ScriptMetadata> scripts)
|
||||
{
|
||||
Scripts = scripts;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user