async void OnTakeABreak(object sender, EventArgs args) { ActivityTimer.Stop(); OnSwitchingPages(); await App.Navigation.PushAsync(new TakingBreakPage(this, CurrentActivity)); }
internal static void ShowStandardInterface() { Properties.Settings.Default.ShowInterface = true; ShowTopandBottom(true); ShowNavigation(false); ShowShortcuts(false); if (ActivityTimer != null) { ActivityTimer.Stop(); } }
private async void OpenStopActivityPage() { CurrentActivity.EndTime = DateTime.Now; ActivityTimer.Stop(); OnSwitchingPages(); bool next = false; if (HasStoppedActivity || IsStopWorkday) { next = true; } await App.Navigation.PushAsync(new StopActivityPage(this, CurrentActivity, next)); }
private void FinishActivityTracking() { Speak("Activity finished") .ConfigureAwait(false); StopListening() .ConfigureAwait(false); Activity.Stop(); Model.OnActivity = false; Model.CurrentColspan = 2; Model.CurrentAction = "Iniciar"; Model.ElapsedTime = "00:00"; dialogs.Alert(new AlertConfig { OkText = "Aceptar", Title = "Resumen de actividad", Message = $"Duración: {FormatTime(Activity.GetTotalActivityTime())}", }); }
/// <summary> /// Dispose the control /// </summary> /// <param name="disposing">If a disposing is already processing</param> private void Dispose(bool disposing) { if (_disposed) { return; } Loaded -= OnLoaded; MediaPlayerTimer.Tick -= MediaPlayerTimerTick; MediaPlayerTimer.Stop(); ActivityTimer.Tick -= OnInactivity; ActivityTimer.Stop(); InputManager.Current.PreProcessInput -= OnActivity; Player.VlcMediaPlayer.EndReached -= MediaPlayerEndReached; MediaPlayerIsPlaying = false; Player.Stop(); Player.Dispose(); var window = System.Windows.Window.GetWindow(this); if (window != null) { window.Cursor = Cursors.Arrow; } var vm = DataContext as MediaPlayerViewModel; if (vm != null) { vm.StoppedPlayingMedia -= OnStoppedPlayingMedia; } _disposed = true; if (disposing) { GC.SuppressFinalize(this); } }
/// <summary> /// Dispose the control /// </summary> /// <param name="disposing">If a disposing is already processing</param> private void Dispose(bool disposing) { if (Disposed) { return; } Loaded -= OnLoaded; MediaPlayerTimer.Tick -= MediaPlayerTimerTick; MediaPlayerTimer.Stop(); ActivityTimer.Tick -= OnInactivity; ActivityTimer.Stop(); InputManager.Current.PreProcessInput -= OnActivity; Player.VlcMediaPlayer.EndReached -= MediaPlayerEndReached; MediaPlayerIsPlaying = false; Task.Run(() => { Player.Stop(); //Player.Dispose(); DispatcherHelper.CheckBeginInvokeOnUI(() => { var vm = DataContext as MoviePlayerViewModel; if (vm != null) { vm.StoppedPlayingMedia -= OnStoppedPlayingMedia; } Disposed = true; if (disposing) { GC.SuppressFinalize(this); } }); }); }
//submit button clicked private void SubmitButtonClick(object sender, EventArgs e) { //if message is set to send to all then send username and message to all clients if (privateMessageBox.SelectedIndex == 0) { mClient.SendChatMessage(InputField.Text, UsernameInput.Text); } //send message and username to the user ID selected else { mClient.SendPrivateMessage(InputField.Text, UsernameInput.Text, privateMessageBox.SelectedIndex - 1); } //clear input text InputField.Clear(); //reset activity timer ActivityTimer.Stop(); ActivityTimer.Start(); }
/// <summary> /// Dispose the control /// </summary> /// <param name="disposing">If a disposing is already processing</param> private void Dispose(bool disposing) { if (Disposed) { return; } Loaded -= OnLoaded; MediaPlayerTimer.Tick -= MediaPlayerTimerTick; MediaPlayerTimer.Stop(); ActivityTimer.Tick -= OnInactivity; ActivityTimer.Stop(); InputManager.Current.PreProcessInput -= OnActivity; Player.MediaEnded -= MediaPlayerEndReached; MediaPlayerIsPlaying = false; Player.Stop(); Player.Close(); Player.Dispose(); var vm = DataContext as MoviePlayerViewModel; if (vm != null) { vm.StoppedPlayingMedia -= OnStoppedPlayingMedia; } Disposed = true; if (disposing) { GC.SuppressFinalize(this); } }
/// <summary> /// Stops the timer that controls the stepping of activities. /// </summary> protected virtual void StopActivityTimer() { ActivityTimer.Stop(); }