Exemple #1
0
        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;
                    }
                });
            }
        }
Exemple #2
0
 public void RevertFile()
 {
     RevertFileRequest?.Invoke(this, new FileIOEventArgs());
 }