From 107cde359cde36cd275156fff3eba1e50ae4c45b Mon Sep 17 00:00:00 2001 From: Michael Becker Date: Wed, 25 Dec 2019 02:29:23 -0500 Subject: [PATCH] flush the current data in the hexedit control before we save --- .../Editors/Binary/BinaryEditor.cs | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/CSharp/Libraries/UniversalEditor.UserInterface/Editors/Binary/BinaryEditor.cs b/CSharp/Libraries/UniversalEditor.UserInterface/Editors/Binary/BinaryEditor.cs index 89049057..cfc56020 100644 --- a/CSharp/Libraries/UniversalEditor.UserInterface/Editors/Binary/BinaryEditor.cs +++ b/CSharp/Libraries/UniversalEditor.UserInterface/Editors/Binary/BinaryEditor.cs @@ -46,6 +46,17 @@ namespace UniversalEditor.Editors.Binary throw new NotImplementedException(); } + protected override void OnObjectModelSaving(System.ComponentModel.CancelEventArgs e) + { + base.OnObjectModelSaving(e); + + // flush the current data + BinaryObjectModel bom = (ObjectModel as BinaryObjectModel); + if (bom == null) return; + + bom.Data = hexedit.Data; + } + private static EditorReference _er = null; public override EditorReference MakeReference() {