void futureImprovement_selectionEvent() { MainCanvas.Children.Remove(futureImprovement); try { freestyleMode.unload(); MainCanvas.Children.Remove(freestyleMode); freestyleMode = null; } catch { } string focusFile = System.IO.Path.Combine(userDirectory, "focused.txt"); System.IO.File.WriteAllText(focusFile, focusedString); string focusFileGoals = System.IO.Path.Combine(recordingPath, "Goals.txt"); string goals = focusedPauses + System.Environment.NewLine; goals = goals + focusedGestures + System.Environment.NewLine; goals = goals + focusedPosture + System.Environment.NewLine; System.IO.File.WriteAllText(focusFileGoals, goals); doLogs(); speakTimes = new ArrayList(); gestureTimes = new ArrayList(); myState = States.entryScreen; startAgain(); // loadMode(); }
private void loadFreestyle() { rulesAnalyzerFIFO = new RulesAnalyzerFIFO(this); if (freestyleMode == null) { freestyleMode = new FreestyleMode(); } speakTimes = new ArrayList(); gestureTimes = new ArrayList(); gestureImages = new ImageSource[3]; postureImages = new ImageSource[3]; for (int i = 0; i < 3; i++) { gestureImages[i] = null; postureImages[i] = null; } freestyleMode.Height = this.ActualHeight; freestyleMode.Width = this.ActualWidth; MainCanvas.Children.Add(freestyleMode); Canvas.SetTop(freestyleMode, 0); Canvas.SetLeft(freestyleMode, 0); freestyleMode.Loaded += freeStyle_Loaded; }
public void closeFreeStyleMode() { freestyleMode.setGhostMovingInvisible(); freestyleMode.setOldTextInvisible(); freestyleMode.setGhostInvisible(); freestyleMode.setFeedbackTextInvisible(); MainCanvas.Children.Remove(freestyleMode); //freestyleMode.Visibility = Visibility.Collapsed; freestyleMode.unload(); freestyleMode = null; GC.Collect(); GC.WaitForPendingFinalizers(); // rulesAnalyzerFIFO = null; //TODO doPausesesReflection(); }