public void CheckForExternalChanges() { if (!TheEditor.IsFileOpen || SuppressExternalChangesCheck) { return; } DateTime lastWriteTime = File.GetLastWriteTime(TheSettings.MostRecentFile); if (lastWriteTime != TheEditor.LastWriteTime) { Log.Info("External changes detected."); PromptExternalChangesDetected((r) => { if (r == MessageBoxResult.Yes) { RevertFileRequest?.Invoke(this, new FileIOEventArgs() { SuppressPrompting = true }); } else if (r == MessageBoxResult.No) { SuppressExternalChangesCheck = true; } }); } }
public void RevertFile() { RevertFileRequest?.Invoke(this, new FileIOEventArgs()); }