private void OpenFile() { var fileDialog = new System.Windows.Forms.OpenFileDialog() { FileName = Path.GetFileName(EyeGestureFile) }; var result = fileDialog.ShowDialog(); switch (result) { case System.Windows.Forms.DialogResult.OK: EyeGestureFile = fileDialog.FileName; break; case System.Windows.Forms.DialogResult.Cancel: default: break; } xmlEyeGestures = XmlEyeGestures.ReadFromFile(EyeGestureFile); EyeGesture = GestureList != null && GestureList.Any() ? GestureList[0] : null; if (GestureList.Any()) { DisableAll(); } }
private void DeleteGesture() { if (GestureList != null && GestureList.Contains(EyeGesture)) { GestureList.Remove(EyeGesture); } EyeGesture = GestureList != null && GestureList.Any() ? GestureList[0] : null; }
private void Load() { EyeGesturesEnabled = Settings.Default.EyeGesturesEnabled; EyeGestureFile = Settings.Default.EyeGestureFile; EyeGestureString = Settings.Default.EyeGestureString; xmlEyeGestures = XmlEyeGestures.ReadFromString(EyeGestureString); EyeGesture = GestureList != null && GestureList.Any() ? GestureList[0] : null; }
private void ResetChanges() { xmlEyeGestures = XmlEyeGestures.ReadFromString(EyeGestureString); EyeGesture = GestureList != null && GestureList.Any() ? GestureList[0] : null; Settings.Default.EyeGestureUpdated = true; }