private void OnProjectChanged() { if (File.Exists) // the file may have been deleted { _Editor.ExternalSetSourceText(File.Content); } else { Close(); } }
public EditorForm(EditorControl editorControl, Project.File file) { InitializeComponent(); Text = file.Name; _Editor = editorControl; _Editor.Dock = DockStyle.Fill; _Editor.SourceTextChange += OnSourceTextChange; Controls.Add(_Editor); File = file; _Editor.ExternalSetSourceText(File.Content); Project.Events.Changed += OnProjectChanged; }