победа

This commit is contained in:
2025-02-05 16:01:02 +03:00
parent ed4e97e40f
commit 47c67a22af
9 changed files with 18 additions and 14 deletions
+4 -3
View File
@@ -1,8 +1,8 @@
// See https://aka.ms/new-console-template for more information
using System.Net;
using System.Text;
using Example.Shared;
using mROA.Codegen;
using mROA.Implementation;
using mROA.Implementation.Bootstrap;
@@ -11,13 +11,14 @@ var mixer = new FullMixBuilder();
mixer.Modules.Add(new FrontendContextRepository());
mixer.Modules.Add(new JsonFrontendSerialisationModule());
mixer.Modules.Add(new StreamBasedInteractionModule());
mixer.Modules.Add(new StreamBasedFrontendInteractionModule());
mixer.Modules.Add(new NetworkFrontendBridge(new IPEndPoint(IPAddress.Loopback, 4567)));
mixer.Build();
var context = mixer.GetModule<FrontendContextRepository>();
var factory = context.GetSingleObject(typeof(IPrinterFactory)) as IPrinterFactory;
var factory = context.GetSingleObject(typeof(Example.Shared.IPrinterFactory)) as Example.Shared.IPrinterFactory;
var printer = factory.Create("Test");
var name = printer.Value.GetName();