mirror of
https://github.com/Artemis-RGB/Artemis
synced 2026-11-11 19:36:28 +00:00
Core/UI - Move from Ninject to DryIoc (#754)
This commit is contained in:
1 parent
166cb888c1
commit
b7e723b7e9
121 files changed
+1175
-980
No files matched your search
@@ -11,7 +11,7 @@
|
||||
<PackageReference Include="Avalonia" Version="0.10.18" />
|
||||
<PackageReference Include="Avalonia.ReactiveUI" Version="0.10.18" />
|
||||
<PackageReference Include="Avalonia.Xaml.Behaviors" Version="0.10.18" />
|
||||
<PackageReference Include="Ninject" Version="3.3.6" />
|
||||
<PackageReference Include="DryIoc.dll" Version="5.3.1" />
|
||||
<PackageReference Include="NoStringEvaluating" Version="2.4.0" />
|
||||
<PackageReference Include="ReactiveUI" Version="17.1.50" />
|
||||
<PackageReference Include="ReactiveUI.Validation" Version="2.2.1" />
|
||||
|
||||
@@ -0,0 +1,35 @@
|
||||
using Artemis.Core.DryIoc;
|
||||
using DryIoc;
|
||||
using Microsoft.Extensions.ObjectPool;
|
||||
using NoStringEvaluating;
|
||||
using NoStringEvaluating.Contract;
|
||||
using NoStringEvaluating.Models.Values;
|
||||
using NoStringEvaluating.Services.Cache;
|
||||
using NoStringEvaluating.Services.Checking;
|
||||
using NoStringEvaluating.Services.Parsing;
|
||||
using NoStringEvaluating.Services.Parsing.NodeReaders;
|
||||
|
||||
namespace Artemis.VisualScripting.DryIoc;
|
||||
|
||||
public class NoStringDryIocModule : IModule
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public void Load(IRegistrator builder)
|
||||
{
|
||||
// Pooling
|
||||
builder.RegisterInstance(ObjectPool.Create<Stack<InternalEvaluatorValue>>());
|
||||
builder.RegisterInstance(ObjectPool.Create<List<InternalEvaluatorValue>>());
|
||||
builder.RegisterInstance(ObjectPool.Create<ExtraTypeIdContainer>());
|
||||
|
||||
// Parser
|
||||
builder.Register<IFormulaCache, FormulaCache>(Reuse.Singleton);
|
||||
builder.Register<IFunctionReader, FunctionReader>(Reuse.Singleton);
|
||||
builder.Register<IFormulaParser, FormulaParser>(Reuse.Singleton);
|
||||
|
||||
// Checker
|
||||
builder.Register<IFormulaChecker, FormulaChecker>(Reuse.Singleton);
|
||||
|
||||
// Evaluator
|
||||
builder.Register<INoStringEvaluator, NoStringEvaluator>(Reuse.Singleton);
|
||||
}
|
||||
}
|
||||
@@ -1,41 +0,0 @@
|
||||
using Microsoft.Extensions.ObjectPool;
|
||||
using Ninject.Modules;
|
||||
using NoStringEvaluating;
|
||||
using NoStringEvaluating.Contract;
|
||||
using NoStringEvaluating.Models.Values;
|
||||
using NoStringEvaluating.Services.Cache;
|
||||
using NoStringEvaluating.Services.Checking;
|
||||
using NoStringEvaluating.Services.Parsing;
|
||||
using NoStringEvaluating.Services.Parsing.NodeReaders;
|
||||
|
||||
namespace Artemis.VisualScripting.Ninject;
|
||||
|
||||
public class NoStringNinjectModule : NinjectModule
|
||||
{
|
||||
public override void Load()
|
||||
{
|
||||
// Pooling
|
||||
Bind<ObjectPool<Stack<InternalEvaluatorValue>>>()
|
||||
.ToConstant(ObjectPool.Create<Stack<InternalEvaluatorValue>>())
|
||||
.InSingletonScope();
|
||||
|
||||
Bind<ObjectPool<List<InternalEvaluatorValue>>>()
|
||||
.ToConstant(ObjectPool.Create<List<InternalEvaluatorValue>>())
|
||||
.InSingletonScope();
|
||||
|
||||
Bind<ObjectPool<ExtraTypeIdContainer>>()
|
||||
.ToConstant(ObjectPool.Create<ExtraTypeIdContainer>())
|
||||
.InSingletonScope();
|
||||
|
||||
// Parser
|
||||
Bind<IFormulaCache>().To<FormulaCache>().InSingletonScope();
|
||||
Bind<IFunctionReader>().To<FunctionReader>().InSingletonScope();
|
||||
Bind<IFormulaParser>().To<FormulaParser>().InSingletonScope();
|
||||
|
||||
// Checker
|
||||
Bind<IFormulaChecker>().To<FormulaChecker>().InSingletonScope();
|
||||
|
||||
// Evaluator
|
||||
Bind<INoStringEvaluator>().To<NoStringEvaluator>().InSingletonScope();
|
||||
}
|
||||
}
|
||||
@@ -1,10 +1,5 @@
|
||||
using Artemis.Core;
|
||||
using SkiaSharp;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Artemis.VisualScripting.Nodes.Color
|
||||
{
|
||||
|
||||
@@ -1,11 +1,6 @@
|
||||
using Artemis.Core;
|
||||
using Artemis.Core.ColorScience;
|
||||
using SkiaSharp;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Artemis.VisualScripting.Nodes.Color
|
||||
{
|
||||
|
||||
-2
@@ -1,5 +1,3 @@
|
||||
using Avalonia;
|
||||
using Avalonia.Controls;
|
||||
using Avalonia.Markup.Xaml;
|
||||
using Avalonia.ReactiveUI;
|
||||
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
using Avalonia;
|
||||
using Avalonia.Controls;
|
||||
using Avalonia.Markup.Xaml;
|
||||
using Avalonia.ReactiveUI;
|
||||
|
||||
|
||||
-2
@@ -1,5 +1,3 @@
|
||||
using Avalonia;
|
||||
using Avalonia.Controls;
|
||||
using Avalonia.Markup.Xaml;
|
||||
using Avalonia.ReactiveUI;
|
||||
|
||||
|
||||
+1
-1
@@ -56,7 +56,7 @@ public class ListOperatorPredicateNodeCustomViewModel : CustomNodeViewModel
|
||||
if (_node.Script == null)
|
||||
return;
|
||||
|
||||
await _windowService.ShowDialogAsync<NodeScriptWindowViewModelBase, bool>(("nodeScript", _node.Script));
|
||||
await _windowService.ShowDialogAsync<NodeScriptWindowViewModelBase, bool>(_node.Script);
|
||||
_node.Script.Save();
|
||||
|
||||
_node.Storage ??= new ListOperatorEntity();
|
||||
|
||||
-2
@@ -1,5 +1,3 @@
|
||||
using Avalonia;
|
||||
using Avalonia.Controls;
|
||||
using Avalonia.Markup.Xaml;
|
||||
using Avalonia.ReactiveUI;
|
||||
|
||||
|
||||
Reference in new issue
Block a user