Remove .Common-project
Currently of no use
This commit is contained in:
parent
232231d20d
commit
b1d3ec73c9
31 changed files with 16020 additions and 109 deletions
|
|
@ -1,8 +1,9 @@
|
|||
using InkForge.Desktop.Controllers;
|
||||
using InkForge.Desktop.Data;
|
||||
using InkForge.Desktop.Services;
|
||||
using InkForge.Desktop.ViewModels;
|
||||
using InkForge.Data;
|
||||
using InkForge.Desktop.Data;
|
||||
using InkForge.Desktop.Data.Options;
|
||||
using InkForge.Desktop.Managers;
|
||||
using InkForge.Desktop.Models;
|
||||
using InkForge.Desktop.ViewModels;
|
||||
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
|
||||
|
|
@ -18,13 +19,13 @@ public static class InkForgeServiceCollections
|
|||
{
|
||||
services.AddHttpClient();
|
||||
|
||||
services.AddScoped<IWorkspaceAccessor, WorkspaceAccessor>();
|
||||
services.AddScoped<IDbContextFactory<NoteDbContext>, NoteDbContextFactory>();
|
||||
services.AddScoped(s => s.GetRequiredService<IDbContextFactory<NoteDbContext>>().CreateDbContext());
|
||||
|
||||
services.AddScoped<WorkspaceContext>();
|
||||
services.AddScoped<LocalWorkspaceOptions>();
|
||||
|
||||
services.AddSingleton<LandingViewModel>();
|
||||
services.AddSingleton<WorkspaceController>();
|
||||
services.AddSingleton<WorkspaceManager>();
|
||||
|
||||
Locator.CurrentMutable.RegisterViewsForViewModels(typeof(InkForgeServiceCollections).Assembly);
|
||||
|
||||
|
|
|
|||
|
|
@ -1,19 +1,19 @@
|
|||
namespace Microsoft.Extensions.DependencyInjection
|
||||
{
|
||||
public static class TypeFactory<TFactory, T>
|
||||
where TFactory : struct, IObjectParameters<TFactory>
|
||||
public static class TypeFactory<TArguments, T>
|
||||
where TArguments : IFactoryArguments<TArguments>
|
||||
{
|
||||
private static ObjectFactory<T>? s_objectFactory;
|
||||
|
||||
public static T Create(in TFactory factory, IServiceProvider serviceProvider)
|
||||
public static T Create(IServiceProvider serviceProvider, in TArguments factory)
|
||||
{
|
||||
s_objectFactory ??= ActivatorUtilities.CreateFactory<T>(TFactory.Types);
|
||||
s_objectFactory ??= ActivatorUtilities.CreateFactory<T>(TArguments.Types);
|
||||
return s_objectFactory(serviceProvider, (object[])factory);
|
||||
}
|
||||
}
|
||||
|
||||
public interface IObjectParameters<T>
|
||||
where T : struct, IObjectParameters<T>
|
||||
public interface IFactoryArguments<T>
|
||||
where T : IFactoryArguments<T>
|
||||
{
|
||||
abstract static Type[] Types { get; }
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue