forked from Misaki/GhostEngine
Update editor
This commit is contained in:
@@ -1,26 +0,0 @@
|
||||
using Microsoft.UI.Xaml;
|
||||
|
||||
namespace Ghost.Editor.Core.Utilities;
|
||||
|
||||
public static class EditorApplication
|
||||
{
|
||||
private static IServiceProvider? _serviceProvider;
|
||||
|
||||
public static Application Current => Application.Current;
|
||||
|
||||
internal static void Initialize(IServiceProvider serviceProvider)
|
||||
{
|
||||
_serviceProvider = serviceProvider;
|
||||
}
|
||||
|
||||
public static T GetService<T>()
|
||||
where T : class
|
||||
{
|
||||
if (_serviceProvider?.GetService(typeof(T)) is not T service)
|
||||
{
|
||||
throw new ArgumentException($"{typeof(T)} needs to be registered in ConfigureServices within App.xaml.cs.");
|
||||
}
|
||||
|
||||
return service;
|
||||
}
|
||||
}
|
||||
@@ -1,12 +1,10 @@
|
||||
using Ghost.Data.Models;
|
||||
|
||||
namespace Ghost.Editor.Core.Utilities;
|
||||
|
||||
internal static class FileExtensions
|
||||
{
|
||||
public const string META_FILE_EXTENSION = ".gmeta";
|
||||
|
||||
public const string PROJECT_FILE_EXTENSION = "." + ProjectMetadata.PROJECT_FILE_EXTENSION_NAME;
|
||||
public const string PROJECT_FILE_EXTENSION = ".gproj";
|
||||
public const string TEMPLATE_FILE_EXTENSION = ".gtmpl";
|
||||
public const string SCENE_FILE_EXTENSION = ".gscene";
|
||||
public const string ASSET_FILE_EXTENSION = ".gasset";
|
||||
|
||||
@@ -29,6 +29,12 @@ public static class TypeCache
|
||||
s_types = loadableTypes.Select(t => t.GetTypeInfo()).ToArray();
|
||||
}
|
||||
|
||||
internal static void Init()
|
||||
{
|
||||
// Intentionally left blank.
|
||||
// This method exists to force the static constructor to run.
|
||||
}
|
||||
|
||||
public static Type[] GetTypes()
|
||||
{
|
||||
return s_types;
|
||||
|
||||
Reference in New Issue
Block a user