Пример #1
0
        private void _view_Web()
        {
            try
            {
                System.Diagnostics.Process.Start(SimpleMiner.Properties.Resources.Web);

                _view.SetWebVisited();
            }
            catch (Exception ex)
            {
                UIHelper.ShowError(ex.Message);
            }
        }
Пример #2
0
        private void _view_Mail()
        {
            try
            {
                string mailto = string.Format("mailto:{0}?Subject={1}&Body={2}", SimpleMiner.Properties.Resources.MailTo, "SimpleMiner", "");
                mailto = Uri.EscapeUriString(mailto);

                System.Diagnostics.Process.Start(mailto);

                _view.SetMailVisited();
            }
            catch (Exception ex)
            {
                UIHelper.ShowError(ex.Message);
            }
        }
Пример #3
0
        public void SaveParams()
        {
            try
            {
                XmlSerializer serializer = new XmlSerializer(typeof(Settings));

                using (var writer = new System.IO.StreamWriter(sSettingsFileName))
                {
                    serializer.Serialize(writer, currentSettings);
                    writer.Flush();
                }
            }
            catch (Exception ex)
            {
                UIHelper.ShowError(new Exception("Error while saving miner settings to file", ex));
            }
        }
Пример #4
0
        private void _view_PropertyChanged(object sender, System.ComponentModel.PropertyChangedEventArgs e)
        {
            _settings.Language = _view.currentLanguage;
            _settings.WriteLog = _view.writeLog;


            if (e.PropertyName == "language")
            {
                UIHelper.ShowInfo(SimpleMiner.Properties.Resources.OptChangeLanguageMessage);
            }

            try
            {
                SettingsManager.instance.SaveParams();
            }
            catch (Exception ex)
            {
                UIHelper.ShowError(new Exception("Error while saving params", ex));
            }
        }
Пример #5
0
        Settings LoadSavedParams()
        {
            try
            {
                if (!File.Exists(sSettingsFileName))
                {
                    return(null);
                }

                using (var stream = System.IO.File.OpenRead(sSettingsFileName))
                {
                    var serializer = new XmlSerializer(typeof(Settings));
                    return(serializer.Deserialize(stream) as Settings);
                }
            }
            catch (Exception ex)
            {
                UIHelper.ShowError(new Exception("Error while loading miner settings from file", ex));
            }

            return(null);
        }
Пример #6
0
        void CreateMiners()
        {
            try
            {
                tabControlMiners.ImageList = imageListForTabs;

                // About
                ucAbout        ucAbout          = new ucAbout();
                AboutPresenter _about_presenter = new AboutPresenter(ucAbout);

                TabPage tabAbout = new TabPage(SimpleMiner.Properties.Resources.tabAbout);
                tabAbout.ImageIndex = 0;
                tabAbout.Controls.Add(ucAbout);
                ucAbout.Dock = DockStyle.Fill;
                tabControlMiners.Controls.Add(tabAbout);

                // Test

                /* ucMiner1 ucMiner1 = new ucMiner1();
                 * ucBaseMiner ucBaseMiner1 = new ucBaseMiner();
                 * BaseMinerPresenter _presenter = new BaseMinerPresenter(ucBaseMiner1, new BaseMinerModelEx());
                 *
                 *
                 * TabPage tabMiner1 = new TabPage("Test (redirect output)");
                 * tabMiner1.Controls.Add(ucBaseMiner1);
                 * ucBaseMiner1.Dock = DockStyle.Fill;
                 *
                 * tabControlMiners.Controls.Add(tabMiner1);*/

                // Claymore
                SimpleMiner.Claymor.ucClaymorMiner ucClaymore = new SimpleMiner.Claymor.ucClaymorMiner();
                ClaymorMinerPresenter _claymore_presenter     = new ClaymorMinerPresenter(ucClaymore, new ClaymorMinerModel());

                TabPage tabClaymoreMiner = new TabPage(SimpleMiner.Properties.Resources.tabEthereum);
                tabClaymoreMiner.ImageIndex = 1;
                tabClaymoreMiner.Controls.Add(ucClaymore);
                ucClaymore.Dock = DockStyle.Fill;
                tabControlMiners.Controls.Add(tabClaymoreMiner);

                // ZClaymore
                SimpleMiner.Claymor.ucClaymorZMiner ucZClaymore = new SimpleMiner.Claymor.ucClaymorZMiner();
                ClaymorZMinerPresenter _claymore_z_presenter    = new ClaymorZMinerPresenter(ucZClaymore, new ClaymorMinerModel());

                TabPage tabClaymoreZMiner = new TabPage("ZCash (Radeon)");
                tabClaymoreZMiner.ImageIndex = 3;
                tabClaymoreZMiner.Controls.Add(ucZClaymore);
                ucZClaymore.Dock = DockStyle.Fill;
                tabControlMiners.Controls.Add(tabClaymoreZMiner);

                // Options
                ucOptions        ucOptions          = new ucOptions();
                OptionsPresenter _options_presenter = new OptionsPresenter(ucOptions, SettingsManager.instance.currentSettings);

                TabPage tabOptions = new TabPage(SimpleMiner.Properties.Resources.tabOptions);
                tabOptions.ImageIndex = 2;
                tabOptions.Controls.Add(ucOptions);
                ucOptions.Dock = DockStyle.Fill;
                tabControlMiners.Controls.Add(tabOptions);
            }
            catch (Exception ex)
            {
                UIHelper.ShowError(ex);
            }
        }
Пример #7
0
 private static void Application_ThreadException(object sender, System.Threading.ThreadExceptionEventArgs e)
 {
     UIHelper.ShowError(e.Exception);
 }