private void Window_Initialized(object sender, EventArgs e)
        {
            try
            {
                if (!_proxy.Start())
                {
                    MessageBox.Show("Couldn't connect to server, please check if the service is running!",
                        "Fatal error",
                        MessageBoxButton.OK, MessageBoxImage.Error);
                    Close();
                    return;
                }

                _config = _proxy.ReadConfig();
            }
            catch
            {
                MessageBox.Show("Couldn't request configuration, make sure the SCP DSx Service is running!",
                    "Couldn't fetch configuration",
                    MessageBoxButton.OK, MessageBoxImage.Error);
                Close();
                return;
            }

            _config.IdleTimeout /= GlobalConfiguration.IdleTimeoutMultiplier;
            _config.Latency /= GlobalConfiguration.LatencyMultiplier;

            DataContext = null;
            DataContext = _config;
        }
 public static void Submit(GlobalConfiguration configuration)
 {
     foreach (
         var propertyInfo in
             typeof(GlobalConfiguration).GetProperties().Where(propertyInfo => propertyInfo.CanWrite))
     {
         propertyInfo.SetValue(Instance, propertyInfo.GetValue(configuration));
     }
 }
Beispiel #3
0
        public void Request()
        {
            _config = _proxy.ReadConfig();

            tbIdle.Value = _config.IdleTimeout/GlobalConfiguration.IdleTimeoutMultiplier;
            cbLX.Checked = _config.FlipLX;
            cbLY.Checked = _config.FlipLY;
            cbRX.Checked = _config.FlipRX;
            cbRY.Checked = _config.FlipRY;
            cbLED.Checked = _config.DisableLED;
            cbRumble.Checked = _config.DisableRumble;
            cbTriggers.Checked = _config.SwapTriggers;
            tbLatency.Value = _config.Latency/GlobalConfiguration.LatencyMultiplier;
            tbLeft.Value = _config.DeadZoneL;
            tbRight.Value = _config.DeadZoneR;
            cbNative.Checked = _config.DisableNative;
            cbSSP.Checked = _config.DisableSSP;
            tbBrightness.Value = _config.Brightness;
            cbForce.Checked = _config.Repair;
        }
Beispiel #4
0
 /// <summary>
 ///     Submits an altered copy of the global configuration to the root hub and saves it.
 /// </summary>
 /// <param name="configuration">The global configuration object.</param>
 public void SubmitConfiguration(GlobalConfiguration configuration)
 {
     GlobalConfiguration.Submit(configuration);
     GlobalConfiguration.Save();
 }
Beispiel #5
0
 public void WriteConfig(GlobalConfiguration config)
 {
     _rootHub.SubmitConfiguration(config);
 }
        private void Window_Initialized(object sender, EventArgs e)
        {
            if (!_proxy.Start())
            {
                MessageBox.Show("Couldn't connect to server, please check if the service is running!",
                    "Fatal error",
                    MessageBoxButton.OK, MessageBoxImage.Error);
                Close();
                return;
            }

            _config = _proxy.ReadConfig();

            _config.IdleTimeout /= GlobalConfiguration.IdleTimeoutMultiplier;
            _config.Latency /= GlobalConfiguration.LatencyMultiplier;

            MainAccordion.DataContext = _config;
        }