예제 #1
0
        public SettingsForm(ApplicationConfiguration applicationConfiguration, XgminerConfiguration minerConfiguration,
            PathConfiguration pathConfiguration)
        {
            InitializeComponent();

            this.minerConfiguration = minerConfiguration;
            this.applicationConfiguration = applicationConfiguration;
            this.pathConfiguration = pathConfiguration;
        }
예제 #2
0
        public AdvancedSettingsForm(ApplicationConfiguration applicationConfiguration, PathConfiguration pathConfiguration)
        {
            InitializeComponent();

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

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

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

            if (String.IsNullOrEmpty(workingPathConfiguration.SharedConfigPath))
                workingPathConfiguration.SharedConfigPath = ApplicationPaths.AppDataPath();
        }
예제 #3
0
        static void Main()
        {
            using (Mutex mutex = new Mutex(false, "Global\\" + appGuid))
            {
                if (!mutex.WaitOne(0, false))
                {
                    PathConfiguration pathConfig = new PathConfiguration();
                    pathConfig.LoadPathConfiguration();
                    ApplicationConfiguration appConfig = new ApplicationConfiguration();
                    appConfig.LoadApplicationConfiguration(pathConfig.SharedConfigPath);
                    if (!appConfig.AllowMultipleInstances)
                        return;
                }

                RunApplication();
            }
        }
예제 #4
0
        private void ConfigureSettingsRemotely()
        {
            ApplicationConfiguration workingApplicationConfiguration = new ApplicationConfiguration();
            EngineConfiguration workingEngineConfiguration = new EngineConfiguration();
            PathConfiguration workingPathConfiguration = new PathConfiguration();

            GetRemoteApplicationConfiguration(this.selectedRemoteInstance);

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

            SettingsForm settingsForm = new SettingsForm(workingApplicationConfiguration, workingEngineConfiguration.XgminerConfiguration, workingPathConfiguration);
            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, this.remoteApplicationConfig);
                ObjectCopier.CopyObject(workingEngineConfiguration, this.remoteEngineConfig);
                ObjectCopier.CopyObject(workingPathConfiguration, this.remotePathConfig);

                SetConfigurationRemotely(this.selectedRemoteInstance, this.remoteApplicationConfig, this.remoteEngineConfig, this.remotePathConfig, null);
            }
        }
예제 #5
0
        public void LoadPathConfiguration()
        {
            PathConfiguration tmp = ConfigurationReaderWriter.ReadConfiguration <PathConfiguration>(PathConfigurationFileName());

            ObjectCopier.CopyObject(tmp, this);
        }