コード例 #1
0
        public static IApplicationBuilder StartNode(string[] args, KillRecpientType type)
        {
            //Assemblys.WireUp();
            return(ActorApplication.Create(args)
                   .ConfigureAutoFac(cb =>
            {
                cb.RegisterType <ConsoleAppRoute>().Named <IAppRoute>("default");
                cb.RegisterType <KillHelper>().As <IStartUpAction>();
            })
                   .ConfigurateNode()
                   .ConfigureLogging((context, configuration) =>
            {
                Console.Title = context.HostEnvironment.ApplicationName;

                configuration.WriteTo.ColoredConsole();
            })
                   .ConfigurateAkkaSystem((context, system) =>
            {
                if (type == KillRecpientType.Seed)
                {
                    KillSwitch.Setup(system);
                }
                else
                {
                    KillSwitch.Subscribe(system, type);
                }
            }));
        }
コード例 #2
0
        public static async Task Main(string[] args)
        {
            SyncfusionLicenseProvider.RegisterLicense("MjY0ODk0QDMxMzgyZTMxMmUzMEx6Vkt0M1ZIRFVPRWFqMEcwbWVrK3dqUldkYzZiaXA3TGFlWDFORDFNSms9");

            switch (IpConfigurationChecker.CheckConfiguration())
            {
            case null:
                Environment.ExitCode = -1;
                return;

            case true:
                await ActorApplication.Create(args)
                .ConfigurateNode()
                .ConfigureLogging((context, configuration) => configuration.WriteTo.Sink <SeriLogViewerSink>())
                .ConfigurateAkkaSystem((context, system) => system.RegisterLocalization())
                .ConfigurateAkkaSystem((context, system) => KillSwitch.Subscribe(system, KillRecpientType.Frontend))
                .ConfigurateAkkaSystem(
                    (context, system) =>
                    Cluster.Get(system)
                    .RegisterOnMemberUp(
                        () => ServiceRegistry.GetRegistry(system).RegisterService(new RegisterService(context.HostEnvironment.ApplicationName, Cluster.Get(system).SelfUniqueAddress))))
                .ConfigureAutoFac(cb => cb.RegisterModule <CoreModule>())
                .UseWpf <MainWindow>(configuration => configuration.WithAppFactory(() => new App()))
                .Build().Run();

                break;

            case false:
                Process.Start(System.Windows.Forms.Application.ExecutablePath.Replace(".dll", ".exe"), Environment.CommandLine);
                break;
            }
        }
コード例 #3
0
        //"pack: //application:,,,/Tauron.Application.Localizer;component/Theme.xaml"

        public static async Task Main(string[] args)
        {
            SyncfusionLicenseProvider.RegisterLicense("MjY0ODk0QDMxMzgyZTMxMmUzMEx6Vkt0M1ZIRFVPRWFqMEcwbWVrK3dqUldkYzZiaXA3TGFlWDFORDFNSms9");

            var builder = ActorApplication.Create(args);

            builder
            .ConfigureLogging((context, configuration) => configuration.ConfigDefaultLogging("Localizer").WriteTo.Sink <SeriLogViewerSink>())
            .ConfigureAutoFac(cb => cb.RegisterModule <MainModule>().RegisterModule <UIModule>())
            .ConfigurateAkkaSystem((context, system) => system.RegisterLocalization())
            .UseWpf <MainWindow>(c => c.WithAppFactory(() =>
            {
                var runapp = new System.Windows.Application();
                //{
                //    Resources = new ResourceDictionary
                //    {
                //        Source = new Uri("/Theme.xaml", UriKind.Relative)
                //    }
                //};


                return(runapp);
            }));

            using var app = builder.Build();
            await app.Run();
        }
コード例 #4
0
        public static async Task Main(string[] args)
        {
            var builder = ActorApplication.Create(args);

            builder
            //.ConfigureAkka(context =>
            //               {
            //                   //var config = new AkkaRootConfiguration();
            //                   //config.Akka.ElementAcessor.GetAddElement<DispatcherConfiguration>("CallingThread").Type = typeof(CallingThreadDispatcherInternalConfigurator);

            //                   //return config.CreateConfig();
            //               })
            .ConfigureLogging((context, configuration) => configuration.ConfigDefaultLogging("MGI_Helper").WriteTo.Sink <SeriLogViewerSink>())
            .ConfigureAutoFac(cb => cb.RegisterModule <MainModule>())
            .ConfigurateAkkaSystem((context, system) => system.RegisterLocalization())
            .UseWpf <MainWindow>(c => c.WithAppFactory(() => new App()));

            using var app = builder.Build();
            await app.Run();
        }