// Open the quickPaste Editor window private void QuickPasteEntryEdit(QuickPasteEntry quickPasteEntry) { if (quickPasteEntry == null) { return; } // Make sure the quickPasteWindow is not topmost, as it may otherwise occlude part of the QuickPaste Editor if (this.quickPasteWindow.IsLoaded) { this.quickPasteWindow.Topmost = false; } QuickPasteEditor quickPasteEditor = new QuickPasteEditor(quickPasteEntry, this.DataHandler.FileDatabase, this.DataEntryControls) { Owner = this }; if (quickPasteEditor.ShowDialog() == true) { this.QuickPasteRefreshWindowAndXML(); } // Restore the quickPaste window back to its topmost state if (this.quickPasteWindow.IsLoaded) { this.quickPasteWindow.Topmost = true; } }
// Create a quickpaste entry from the current data controls, // add it to the quickpaste entries, and update the display and the ImageSetTable database as needed private void QuickPasteEntryNew() { string title = "QuickPaste #" + (this.quickPasteEntries.Count + 1).ToString(); QuickPasteEntry quickPasteEntry = QuickPasteOperations.TryGetQuickPasteItemFromDataFields(this.DataHandler.FileDatabase, this.DataHandler.ImageCache.CurrentRow, title); if (quickPasteEntry == null) { return; } // Make sure the quickPasteWindow is not topmost, as it may otherwise occlude part of the QuickPaste Editor if (this.quickPasteWindow.IsLoaded) { this.quickPasteWindow.Topmost = false; } QuickPasteEditor quickPasteEditor = new QuickPasteEditor(quickPasteEntry, this.DataHandler.FileDatabase, this.DataEntryControls) { Owner = this }; if (quickPasteEditor.ShowDialog() == true) { quickPasteEntry = quickPasteEditor.QuickPasteEntry; if (this.quickPasteEntries == null) { // This shouldn't be necessary, but just in case... this.quickPasteEntries = new List <QuickPasteEntry>(); } this.quickPasteEntries.Add(quickPasteEntry); this.QuickPasteRefreshWindowAndXML(); } // Restore the quickPaste window back to its topmost state if (this.quickPasteWindow.IsLoaded) { this.quickPasteWindow.Topmost = true; } }