Refactor activation handling and introduce entity system
Added new `ActivationHandler` class for folder initialization. Added `ProjectService` class for project-related operations. Added `Ghost.Entities` project with entity management classes. Added `EngineEditorWindow` for enhanced user interface. Changed project files to restructure dependencies and remove unused references. Changed `ProjectRepository` to use asynchronous methods for improved performance. Changed data binding in `CreateProjectPage.xaml` and `OpenProjectPage.xaml` to use new data models. Changed `App.xaml.cs` to utilize the new `ActivationHandler` and include additional services. Removed `IActivationHandler` interface and integrated its functionality into `ActivationHandler`. Removed `EditorActivationHandler` as its functionality was merged into `ActivationHandler`. Updated `AssemblyInfo.cs` to include global using directives for entity types. Updated image assets to reflect visual resource changes.
This commit is contained in:
32
Ghost.Data/Models/ProjectInfo.cs
Normal file
32
Ghost.Data/Models/ProjectInfo.cs
Normal file
@@ -0,0 +1,32 @@
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
|
||||
namespace Ghost.Data.Models;
|
||||
|
||||
public class ProjectInfo
|
||||
{
|
||||
[DatabaseGenerated(DatabaseGeneratedOption.Identity)]
|
||||
public int ID
|
||||
{
|
||||
get; set;
|
||||
}
|
||||
|
||||
public required string Name
|
||||
{
|
||||
get; set;
|
||||
}
|
||||
|
||||
public required string Path
|
||||
{
|
||||
get; set;
|
||||
}
|
||||
|
||||
public required Version EngineVersion
|
||||
{
|
||||
get; set;
|
||||
}
|
||||
|
||||
public required DateTime LastOpened
|
||||
{
|
||||
get; set;
|
||||
}
|
||||
}
|
||||
44
Ghost.Data/Models/TemplateInfo.cs
Normal file
44
Ghost.Data/Models/TemplateInfo.cs
Normal file
@@ -0,0 +1,44 @@
|
||||
namespace Ghost.Data.Models;
|
||||
|
||||
public class TemplateInfo
|
||||
{
|
||||
public required string Name
|
||||
{
|
||||
get; set;
|
||||
}
|
||||
|
||||
public string? Description
|
||||
{
|
||||
get; set;
|
||||
}
|
||||
|
||||
public required Version TemplateVersion
|
||||
{
|
||||
get; set;
|
||||
}
|
||||
|
||||
public required Version EngineVersion
|
||||
{
|
||||
get; set;
|
||||
}
|
||||
}
|
||||
|
||||
public class TemplateData(string templatePath, TemplateInfo info)
|
||||
{
|
||||
private const string _ICON_NAME = "icon.png";
|
||||
private const string _PREVIEW_NAME = "preview.png";
|
||||
|
||||
public string directory = Path.GetDirectoryName(templatePath)!;
|
||||
|
||||
public TemplateInfo Info => info;
|
||||
|
||||
public Uri GetIconURI()
|
||||
{
|
||||
return new Uri(Path.Combine(directory, _ICON_NAME));
|
||||
}
|
||||
|
||||
public Uri GetPreviewURI()
|
||||
{
|
||||
return new Uri(Path.Combine(directory, _PREVIEW_NAME));
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user