Ejemplo n.º 1
0
        private void settingsToolStripMenuItem_Click(object sender, EventArgs e)
        {
            var formSettings = new FrmSettings();

            formSettings.ShowDialog(this);
            _minerProcess.Stop();
            _minerProcess.ProcessName    = Properties.Settings.Default.MinerProcessName;
            _minerProcess.FilePath       = Properties.Settings.Default.MinerWorkingFolder;
            _minerProcess.FileName       = Properties.Settings.Default.MinerPath;
            _minerProcess.AutoStartMiner = Properties.Settings.Default.AutoStartMiner;
            _minerProcess.Start();
        }
Ejemplo n.º 2
0
        public frmWatchDog()
        {
            InitializeComponent();

            var processName = Properties.Settings.Default.MinerProcessName;

            _minerProcess = new MinerProcess(processName, Properties.Settings.Default.AutoStartMiner,
                                             Properties.Settings.Default.MinerPath, Properties.Settings.Default.MinerWorkingFolder);
            _minerProcess.StatusChangedEvent += StatusChangedEvent;
            _minerProcess.Start();

            if (Properties.Settings.Default.AutoStartMiner)
            {
                lblProcessName.ForeColor = Color.Green;
                lblProcessId.ForeColor   = Color.Green;
            }

            //var logger = new Logger();
            //var messageHandler = new SubscriptionMessageHandler(logger);
            //var messageController = new SubscriptionMessageController(logger, messageHandler);
            //messageController.OnRestartMiner += OnRestartMiner;
            //messageController.StartReceiving();
        }