private void FilesNotebookFiles_OpenFileSelectionChanged(object sender, FilesNotebook.FileBufferEventArgs e) { if (e.FileBuffer == filesNotebookFiles.CurrentFileBuffer) UpdateActions(); }
private void FilesNotebookFiles_OpenFileModifiedChanged(object sender, FilesNotebook.FileBufferEventArgs e) { UpdateActions(); }
private void FilesNotebookFiles_CurrentOpenFileTitleChanged(object sender, FilesNotebook.FileBufferEventArgs e) { if (e.FileBuffer == filesNotebookFiles.CurrentFileBuffer) UpdateTitle(); }
private void FilesNotebookFiles_OpenFileClosing(object sender, FilesNotebook.FileBufferCancelEventArgs e) { if (e.FileBuffer.Modified) { string fileName = e.FileBuffer.FileInfo == null ? FileBuffer.NewFileTitle : e.FileBuffer.FileInfo.FullName; using (var md = new Gtk.MessageDialog(this, Gtk.DialogFlags.Modal, Gtk.MessageType.Question, Gtk.ButtonsType.YesNo, "File '" + fileName + "' is modified but not saved! Do you want to close it anyway?")) { int res = md.Run(); if (res == (int) Gtk.ResponseType.No) e.Cancel = true; md.Destroy(); } } }
private void ConstructFilesNotebookFiles() { Debug.WriteLine("ConstructFilesNotebookFiles"); filesNotebookFiles = new FilesNotebook { Name = "filesNotebookFiles", Visible = true, BorderWidth = 1, }; filesNotebookFiles.CurrentFileBufferChanged += FilesNotebookFiles_CurrentOpenFileChanged; filesNotebookFiles.FileBufferChanged += FilesNotebookFiles_OpenFileChanged; filesNotebookFiles.FileBufferModifiedChanged += FilesNotebookFiles_OpenFileModifiedChanged; filesNotebookFiles.FileBufferTitleChanged += FilesNotebookFiles_CurrentOpenFileTitleChanged; filesNotebookFiles.FileBufferSelectionChanged += FilesNotebookFiles_OpenFileSelectionChanged; filesNotebookFiles.FileBufferClosing += FilesNotebookFiles_OpenFileClosing; }