public override void ExecuteTask(IGarminDevice device) { if(GarminDeviceManager.Instance.m_Controllers.Count > 0) { GarminDeviceManager.Instance.m_Controllers[0].FindDevices(); } }
public override void ExecuteTask(IGarminDevice device) { // This function is not supported on the device if (!device.SupportsReadProfile && !device.SupportsFITProfile) { throw new NoDeviceSupportException(device, GarminFitnessView.GetLocalizedString("ImportProfileText")); } else { device.ReadProfile(GarminProfileManager.Instance.UserProfile); } }
public override void ExecuteTask(IGarminDevice device) { // This function is not supported on the device if (!device.SupportsReadWorkout && !device.SupportsFITWorkouts) { throw new NoDeviceSupportException(device, GarminFitnessView.GetLocalizedString("ImportWorkoutsText")); } else { device.ReadWorkouts(); } }
private void OnWriteToDeviceCompleted(IGarminDevice device, DeviceOperations operation, Boolean succeeded, String failureMessage) { String errorText = String.Empty; if (CurrentTask.Type == BasicTask.TaskTypes.ExportWorkout) { Logger.Instance.LogText("Completed export workouts"); Debug.Assert(operation == DeviceOperations.WriteWorkout); if (!succeeded) { errorText = GarminFitnessView.GetLocalizedString("ExportWorkoutsErrorText"); if (!String.IsNullOrEmpty(failureMessage)) { errorText += "\n\nReason :\n" + failureMessage; } } } else if (CurrentTask.Type == BasicTask.TaskTypes.ExportProfile) { Logger.Instance.LogText("Completed export profile"); Debug.Assert(operation == DeviceOperations.WriteProfile); if (!succeeded) { errorText = GarminFitnessView.GetLocalizedString("ExportProfileErrorText"); if (!String.IsNullOrEmpty(failureMessage)) { errorText += "\n\nReason :\n" + failureMessage; } } } CompleteCurrentTask(succeeded, errorText); }
public virtual void ExecuteTask(IGarminDevice device) { }
private void OnOperationToDeviceWillComplete(IGarminDevice device, DeviceOperations operation) { m_TimeoutTimer.Stop(); if (m_CancelDialog != null) { m_CancelDialog.Close(); m_CancelDialog.Dispose(); m_CancelDialog = null; } }
private void OnOperationProgressed(IGarminDevice device, DeviceOperations operation, int progress) { }
private void DevicesComboBox_SelectionChangeCommitted(object sender, System.EventArgs e) { m_SelectedDevice = GarminDeviceManager.Instance.Devices[DevicesComboBox.SelectedIndex]; }
private void RefreshDeviceComboBox() { DevicesComboBox.Items.Clear(); for (int i = 0; i < GarminDeviceManager.Instance.Devices.Count; ++i) { DevicesComboBox.Items.Add(GarminDeviceManager.Instance.Devices[i].DisplayName); } if (GarminDeviceManager.Instance.Devices.Count > 0) { m_SelectedDevice = GarminDeviceManager.Instance.Devices[0]; DevicesComboBox.SelectedIndex = 0; } OKButton.Enabled = (m_SelectedDevice != null); }
public NoDeviceSupportException(IGarminDevice device, String operation) : base(String.Format(GarminFitnessView.GetLocalizedString("NoDeviceSupportText"), device.DisplayName, operation)) { }