Exemplo n.º 1
0
        static void Main(string[] args)
        {
            var sCtx = new ServerContext("..//..//..//..//..//instance//prime-server.config");

            var logger = new ConsoleLogger()
            {
                IncludePreamble = true
            };

            sCtx.L = logger;

            logger.Log(": Operating system: " + Environment.OSVersion.Platform);
            logger.Log(": Current directory: " + Environment.CurrentDirectory);

            var server = new MessageServer(sCtx);

            server.Start();

            foreach (var i in server.TypeBinder.TypeCatalogue)
            {
                logger.Log(server.TypeBinder.TypeCatalogue.Get(i));
            }

            // Start message listener.
            var keysManager = new KeyManagerServer(sCtx);

            Task.Run(() => { keysManager.Run(); });
            logger.Log(": Server started");

            // Start UI.
            var uiTask = Task.Run(() =>
            {
                var process = RunUi();

                logger.Log($": Electron UI started ({process.Id}).");
                process.WaitForExit();
            });

            logger.Log(": UI started");
            logger.Log(": Waiting for all UI processes exit...");

            uiTask.Wait();
        }
Exemplo n.º 2
0
 public void Main(ServerContext context)
 {
     KeyManagerServerInstance = new KeyManagerServer(context);
     KeyManagerServerInstance.Run();
 }