예제 #1
0
        public void Dispose()
        {
            if (CancellationTokenSourceDurationTest != null)
            {
                CancellationTokenSourceDurationTest.Cancel();
            }

            if (TaskStartDurationTest != null)
            {
                TaskStartDurationTest.Dispose();
            }

            if (CancellationTokenSourceAppDomainTask != null)
            {
                CancellationTokenSourceAppDomainTask.Cancel();
            }

            if (AppDomainTask != null)
            {
                AppDomainTask.Dispose();
            }

            if (FiddlerCapture != null)
            {
                FiddlerCapture.Dispose();
            }

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

            Settings.Default.Save();
        }
        public StopFiddlerCaptureCommand(FiddlerCapture fiddlerCapture)
        {
            if (fiddlerCapture == null)
            {
                throw new ArgumentNullException("fiddlerCapture");
            }

            FiddlerCapture = fiddlerCapture;

            FiddlerCapture.PropertyChanged += FiddlerCapture_PropertyChanged;
        }
예제 #3
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;
        }