示例#1
0
        static void Main()
        {
            try
            {
                var ac = new AppConfig();

                App app;
                if (ac.mode.ToLower() == "daemon")
                {
                    if (AppInstanceAlreadyRunning(ac.masterIP, ac.masterPort, ac.machineId, true))
                    {
                        return;
                    }
                    app = new DaemonApp(ac);
                    if (ac.HadErrors)
                    {
                        log.Error("Error parsing command line arguments.\n" + ac.GetUsageHelpText());
                    }
                }
                else
                if (ac.mode.ToLower() == "remotecontrolgui")
                {
                    if (ac.HadErrors)
                    {
                        MessageBox.Show(ac.GetUsageHelpText(), "Dirigent - Error parsing command line arguments");
                    }

                    ac.machineId = "none";
                    app          = new TrayApp(ac);
                }
                else // trayApp (the default)
                {
                    if (ac.HadErrors)
                    {
                        MessageBox.Show(ac.GetUsageHelpText(), "Dirigent - Error parsing command line arguments");
                    }

                    if (AppInstanceAlreadyRunning(ac.masterIP, ac.masterPort, ac.machineId, false))
                    {
                        return;
                    }

                    app = new TrayApp(ac);
                }
                app.run();
            }
            catch (Exception ex)
            {
                log.Error(ex);
            }
        }
示例#2
0
        static void Main()
        {
            try
            {
                var ac = new AppConfig();

                App app;
                if (ac.mode.ToLower() == "daemon")
                {
                    app = new DaemonApp(ac);
                    if( ac.HadErrors )
                    {
                        log.Error("Error parsing command line arguments.\n"+ac.GetUsageHelpText());
                    }
                }
                else
                if (ac.mode.ToLower() == "remotecontrolgui")
                {
                    if( ac.HadErrors )
                    {
                        MessageBox.Show( ac.GetUsageHelpText(), "Dirigent - Error parsinbg command line arguments" );
                    }

                    ac.machineId = "none";
                    app = new TrayApp(ac);
                }
                else // trayApp (the default)
                {
                    if( ac.HadErrors )
                    {
                        MessageBox.Show( ac.GetUsageHelpText(), "Dirigent - Error parsinbg command line arguments" );
                    }

                    app = new TrayApp(ac);
                }
                app.run();
            }
            catch( Exception ex )
            {
                log.Error(ex);
            }
        }