From b6f6865e7ae8bb0c1049ea93f1e74f687195b80d Mon Sep 17 00:00:00 2001 From: Michael Becker Date: Sat, 16 Nov 2019 23:57:45 -0500 Subject: [PATCH] Set the object model, data format, and accessor to last used values when saving --- .../Dialogs/DocumentPropertiesDialog.cs | 4 ++++ CSharp/Libraries/UniversalEditor.UserInterface/MainWindow.cs | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/CSharp/Libraries/UniversalEditor.UserInterface/Dialogs/DocumentPropertiesDialog.cs b/CSharp/Libraries/UniversalEditor.UserInterface/Dialogs/DocumentPropertiesDialog.cs index 765a875c..293c120e 100644 --- a/CSharp/Libraries/UniversalEditor.UserInterface/Dialogs/DocumentPropertiesDialog.cs +++ b/CSharp/Libraries/UniversalEditor.UserInterface/Dialogs/DocumentPropertiesDialog.cs @@ -66,6 +66,10 @@ namespace UniversalEditor.UserInterface.Dialogs break; } } + + this.txtObjectModel.Text = ObjectModel?.MakeReference().Title; + this.txtDataFormat.Text = DataFormat?.MakeReference().Title; + this.txtAccessor.Text = Accessor?.GetFileName(); } public DocumentPropertiesDialogMode Mode { get; set; } = DocumentPropertiesDialogMode.Open; diff --git a/CSharp/Libraries/UniversalEditor.UserInterface/MainWindow.cs b/CSharp/Libraries/UniversalEditor.UserInterface/MainWindow.cs index 2ad95182..5d28fb49 100644 --- a/CSharp/Libraries/UniversalEditor.UserInterface/MainWindow.cs +++ b/CSharp/Libraries/UniversalEditor.UserInterface/MainWindow.cs @@ -836,6 +836,10 @@ namespace UniversalEditor.UserInterface using (DocumentPropertiesDialog dlg = new DocumentPropertiesDialog ()) { dlg.Mode = DocumentPropertiesDialogMode.Save; + dlg.ObjectModel = GetCurrentEditorPage().Document.ObjectModel; + dlg.DataFormat = GetCurrentEditorPage().Document.DataFormat; + dlg.Accessor = GetCurrentEditorPage().Document.Accessor; + if (dlg.ShowDialog () == DialogResult.OK) { DataFormat df = dlg.DataFormat;