Ejemplo n.º 1
0
        private bool StartHost(StartHostCommand cmd)
        {
            info.Port                = cmd.port;
            info.Password            = cmd.password;
            info.WantsInProgressGame = cmd.wantsInProgressGame;

            return(commandable.StartServer(cmd.port));
        }
Ejemplo n.º 2
0
        public MainWindowViewModel()
        {
            ManagerDbConnectionString =
                ConfigurationManager.ConnectionStrings["ManagerConnectionString"].ConnectionString;

            ManagerDbRepository =
                new ManagerDbRepository(ManagerDbConnectionString);

            //---------------------------------------
            // Set up Fiddler.
            //---------------------------------------
            FiddlerCaptureUrlConfiguration = new FiddlerCaptureUrlConfiguration();

            FiddlerCapture = new FiddlerCapture(FiddlerCaptureUrlConfiguration);

            FiddlerCapture.NewDataCapturedEventHandler += NewDataCapturedEventHandler;

            StartFiddlerCaptureCommand = new StartFiddlerCaptureCommand(FiddlerCapture);

            StopFiddlerCaptureCommand = new StopFiddlerCaptureCommand(FiddlerCapture);

            FiddlerCaptureInformation = new ObservableCollection <FiddlerCaptureInformation>();

            InstallCertificateCommand = new InstallCertificateCommand();

            UnInstallCertificateCommand = new UnInstallCertificateCommand();

            //---------------------------------------
            // Manager console host.
            //---------------------------------------
            StartHostCommand    = new StartHostCommand(this);
            ShutDownHostCommand = new ShutDownHostCommand(this);

            NumberOfManagers = Settings.Default.NumberOfManagers;
            NumberOfNodes    = Settings.Default.NumberOfNodes;

            IsConsoleHostStarted = false;

            //---------------------------------------
            // Do the rest.
            //---------------------------------------
            GetData();

            ClearLoggingTableInDatabaseCommand = new ClearLoggingTableInDatabaseCommand(this);

            ClearManagerTablesInDatabaseCommand = new ClearManagerTablesInDatabaseCommand(this);

            ToggleRefreshCommand = new ToggleRefreshCommand(this);

            CreateNewJobCommand   = new CreateNewJobCommand();
            Create20NewJobCommand = new CreateNewJobCommand(20);

            StartUpNewManagerCommand = new StartUpNewManagerCommand();
            StartUpNewNodeCommand    = new StartUpNewNodeCommand();

            StartDurationTestCommand  = new StartDurationTestCommand(this);
            CancelDurationTestCommand = new CancelDurationTestCommand(this);

            RefreshTimer = new Timer(5000);

            RefreshTimer.Elapsed += RefreshTimerOnElapsed;

            RefreshTimer.Start();

            RefreshEnabled = true;

            CheckManagerDbTimer          = new Timer(2000);
            CheckManagerDbTimer.Elapsed += CheckManagerDbTimer_Elapsed;
        }