private void _fs_WriteOperation(string path) { if (_textWritten == true) { if (_textSaved == false) { if (_fs.FileExists(path) && path.StartsWith("/home/Documents")) { string fText = _fs.ReadAllText(path); if (fText == _textEditor.Text) { _textSaved = true; _textPath = path; _textEditor.CanClose = true; _textEditor.Close(); _textEditor = null; } } } else { if (_textOpened == true && _textDeleted == false) { if (!_fs.FileExists(path) && path == _textPath) { _textDeleted = true; } } } } }
private void _winsys_WindowListUpdated(object sender, EventArgs e) { if (_winsys.WindowList.Any(x => x.Border.Window is Clock) && _clockOpened == false) { _clockOpened = true; } else { if (_textEditor == null) { var border = _winsys.WindowList.FirstOrDefault(x => x.Border.Window is TextEditorApp); if (border != null) { _textEditor = border.Border.Window as TextEditorApp; } if (_textEditor != null) { if (_textSaved == false) { _textEditor.CanClose = false; } else if (_textOpened == false) { if (_textEditor.FilePath == _textPath) { _textOpened = true; } } } } } if (_textDeleted == true && _calculationDone == false) { var calcs = _winsys.WindowList.Where(x => x.Border.Window is Calculator).Select(x => x.Border.Window as Calculator); _calcs = calcs.ToArray(); } }
public UndoCommand(TextArea textArea, Clipboard clipboard, TextEditorApp textEditorApp) : base(textArea, clipboard) { this.textEditorApp = textEditorApp; }