Esempio n. 1
0
        public SettingsForm(Data.Configuration.Application applicationConfiguration, MultiMiner.Engine.Data.Configuration.Xgminer minerConfiguration,
            Paths pathConfiguration)
        {
            InitializeComponent();

            this.minerConfiguration = minerConfiguration;
            this.applicationConfiguration = applicationConfiguration;
            this.pathConfiguration = pathConfiguration;
        }
        public AdvancedSettingsForm(Application applicationConfiguration, Paths pathConfiguration)
        {
            InitializeComponent();

            this.applicationConfiguration = applicationConfiguration;
            workingApplicationConfiguration = ObjectCopier.CloneObject<Application, Application>(applicationConfiguration);

            this.pathConfiguration = pathConfiguration;
            workingPathConfiguration = ObjectCopier.CloneObject<Paths, Paths>(pathConfiguration);

            if (String.IsNullOrEmpty(workingApplicationConfiguration.LogFilePath))
                workingApplicationConfiguration.LogFilePath = ApplicationPaths.AppDataPath();

            if (String.IsNullOrEmpty(workingPathConfiguration.SharedConfigPath))
                workingPathConfiguration.SharedConfigPath = ApplicationPaths.AppDataPath();
        }
Esempio n. 3
0
        static void Main()
        {
            using (Mutex mutex = new Mutex(false, "Global\\" + appGuid))
            {
                if (!mutex.WaitOne(0, false))
                {
                    Paths pathConfig = new Paths();
                    pathConfig.LoadPathConfiguration();
                    Data.Configuration.Application appConfig = new Data.Configuration.Application();
                    appConfig.LoadApplicationConfiguration(pathConfig.SharedConfigPath);
                    if (!appConfig.AllowMultipleInstances)
                        return;
                }

                RunApplication();
            }
        }
Esempio n. 4
0
        private void ConfigureSettingsRemotely()
        {
            Data.Configuration.Application workingApplicationConfiguration = new Data.Configuration.Application();
            Engine.Data.Configuration.Engine workingEngineConfiguration = new Engine.Data.Configuration.Engine();
            Paths workingPathConfiguration = new Paths();
            Perks workingPerksConfiguration = new Perks();

            GetRemoteApplicationConfiguration(this.selectedRemoteInstance);

            ObjectCopier.CopyObject(this.remoteApplicationConfig.ToModelObject(), workingApplicationConfiguration);
            ObjectCopier.CopyObject(this.remoteEngineConfig.ToModelObject(), workingEngineConfiguration);
            ObjectCopier.CopyObject(this.remotePathConfig, workingPathConfiguration);
            ObjectCopier.CopyObject(this.remotePerksConfig, workingPerksConfiguration);

            SettingsForm settingsForm = new SettingsForm(
                workingApplicationConfiguration,
                workingEngineConfiguration.XgminerConfiguration,
                workingPathConfiguration,
                workingPerksConfiguration);

            settingsForm.Text = String.Format("{0}: {1}", settingsForm.Text, this.selectedRemoteInstance.MachineName);
            DialogResult dialogResult = settingsForm.ShowDialog();

            if (dialogResult == System.Windows.Forms.DialogResult.OK)
            {
                ObjectCopier.CopyObject(workingApplicationConfiguration.ToTransferObject(), this.remoteApplicationConfig);
                ObjectCopier.CopyObject(workingEngineConfiguration.ToTransferObject(), this.remoteEngineConfig);
                ObjectCopier.CopyObject(workingPathConfiguration, this.remotePathConfig);
                ObjectCopier.CopyObject(workingPerksConfiguration, this.remotePerksConfig);

                SetConfigurationRemotely(this.selectedRemoteInstance, this.remoteApplicationConfig, this.remoteEngineConfig, this.remotePathConfig, null);
            }
        }