コード例 #1
0
        public void Start(BrokerAppType app)
        {
            switch (app)
            {
            case BrokerAppType.Publisher:
                StartRabbitMqPublisher();
                break;

            case BrokerAppType.Consumer:
                StartRabbitMqConsumer();
                break;
            }
        }
コード例 #2
0
        public void Start(BrokerAppType app)
        {
            switch (app)
            {
            case BrokerAppType.Publisher:
                for (int i = 0; i < _args.Length; i++)
                {
                    StartRabbitMqPublisher();
                    counter++;
                }

                Console.WriteLine(" Press [enter] to exit.");
                Console.ReadLine();
                break;

            case BrokerAppType.Consumer:
                StartRabbitMqConsumer();
                break;
            }
        }
コード例 #3
0
        public static IntPtr StartProgram(string workingDirectory, DemoAppLauncherSelection app, BrokerAppType subApp, WindowLayout wp)
        {
            var startInfo = new ProcessStartInfo("dotnet");

            startInfo.Arguments        = $"run --no-build {app.ToString()} {subApp.ToString()}";
            startInfo.UseShellExecute  = true;
            startInfo.WorkingDirectory = workingDirectory;

            var process = new Process();

            process.StartInfo = startInfo;
            process.Start();
            Thread.Sleep(500);
            var handle = process.MainWindowHandle;

            if (!MoveWindow((IntPtr)handle, wp.StartX, wp.StartY, wp.Width, wp.Height, true))
            {
                throw new Win32Exception();
            }

            return((IntPtr)handle);
        }