Beispiel #1
0
 public void AddChangePoolEntry(ChangePoolEntry changePoolEntry)
 {
     lock (this)
     {
         this.ChangePool.Add(changePoolEntry);
     }
 }
        private void ReloadFileOpenInIse(ChangePoolEntry changeEntry)
        {
            string path    = changeEntry.PathChanged;
            var    iseFile = this.iseIntegrator.OpenIseFiles.FirstOrDefault(f => f.FullPath == path);

            if (iseFile == null)
            {
                return;
            }
            var fileExists = File.Exists(path);

            if (this.iseIntegrator.IsFileSaved(path))
            {
                if (fileExists)
                {
                    if (this.CompareFileContents(path, iseFile.Editor.Text))
                    {
                        return;
                    }
                    this.iseIntegrator.GoToFile(path);
                }
                string question;
                if (fileExists)
                {
                    question = String.Format("File '{0}' has been modified by another program.\n\nDo you want to reload it?", path);
                }
                else if (changeEntry.PathAfterRename != null)
                {
                    question = String.Format("File '{0}' has been moved to '{1}'.\n\nDo you want to reload it?", path, changeEntry.PathAfterRename);
                }
                else
                {
                    question = String.Format("File '{0}' has been deleted.\n\nDo you want to close it?", path);
                }
                if (this.messageBoxHelper.ShowQuestion("Reload file", question))
                {
                    this.iseIntegrator.CloseFile(path);
                    if (changeEntry.PathAfterRename != null)
                    {
                        this.iseIntegrator.GoToFile(changeEntry.PathAfterRename);
                    }
                    else if (fileExists)
                    {
                        this.iseIntegrator.GoToFile(path);
                    }
                }
            }
            else
            {
                string message;
                if (fileExists)
                {
                    this.iseIntegrator.GoToFile(path);
                    message = String.Format("File '{0}' has been modified by another program.\n\nSince the file had been changed in ISE editor, you will need to reload it manually.", path);
                }
                else if (changeEntry.PathAfterRename != null)
                {
                    message = String.Format("File '{0}' has been moved to '{1}.\n\nSince the file had been changed in ISE editor, you will need to reload it manually.", path, changeEntry.PathAfterRename);
                }
                else
                {
                    message = String.Format("File '{0}' has been deleted. Since the file had been changed in ISE editor, you will need to reload it manually.", path);
                }
                this.messageBoxHelper.ShowInfo(message);
            }
        }