private void SaveSettings(object e) { try { m_device.SelectProfile(new SelectedProfileReport() { Profile = (byte)m_selectedProfile.Id }); foreach (var axis in m_axes) { m_device.SelectAxis(axis.Type); m_device.SetSettings(new SettingsReport() { Settings = axis.ToAxisSettings() }); } m_device.SaveSettings(); } catch { OnErrorOccurred(); } finally { ClearIsChanged(); } }
public AxisCallibrationViewModel(AccelerometerGamePadDevice device, AxisViewModel axis) { m_nextCommand = new RelayCommand(Next, CanNext); m_okCommand = new RelayCommand(Ok, CanOk); m_cancelCommand = new RelayCommand(Cancel); m_device = device; m_axis = axis; m_device.SelectAxis(m_axis.Type); m_timer = new Timer(TimerUpdateTime); m_timer.AutoReset = true; m_timer.Elapsed += m_timer_Elapsed; m_timer.Start(); }