diff options
author | Mike Krüger <mkrueger@xamarin.com> | 2011-10-11 18:30:47 +0400 |
---|---|---|
committer | Mike Krüger <mkrueger@xamarin.com> | 2011-10-11 18:53:18 +0400 |
commit | d73fc81fbe9cd50d32d355618567f974177269eb (patch) | |
tree | ce8dec32046994e1ef50d4006ddcc1316fe8188a /main/src/addins/MonoDevelop.HexEditor | |
parent | 9805bcc45c7f3d046105e4d8384bcf81d324208b (diff) |
Fixed 'Bug 1251 - Hex editor doesn't save'.
Diffstat (limited to 'main/src/addins/MonoDevelop.HexEditor')
-rw-r--r-- | main/src/addins/MonoDevelop.HexEditor/Mono.MHex.Data/HexEditorData.cs | 6 | ||||
-rw-r--r-- | main/src/addins/MonoDevelop.HexEditor/MonoDevelop.HexEditor/HexEditorView.cs | 4 |
2 files changed, 8 insertions, 2 deletions
diff --git a/main/src/addins/MonoDevelop.HexEditor/Mono.MHex.Data/HexEditorData.cs b/main/src/addins/MonoDevelop.HexEditor/Mono.MHex.Data/HexEditorData.cs index 7a48acc053..7193c353d9 100644 --- a/main/src/addins/MonoDevelop.HexEditor/Mono.MHex.Data/HexEditorData.cs +++ b/main/src/addins/MonoDevelop.HexEditor/Mono.MHex.Data/HexEditorData.cs @@ -75,6 +75,12 @@ namespace Mono.MHex.Data } } + public byte[] Bytes { + get { + return GetBytes (0, (int)Length); + } + } + public byte[] GetBytes (long offset, int count) { if (count == 0) diff --git a/main/src/addins/MonoDevelop.HexEditor/MonoDevelop.HexEditor/HexEditorView.cs b/main/src/addins/MonoDevelop.HexEditor/MonoDevelop.HexEditor/HexEditorView.cs index 05dc9e8c45..808c545a80 100644 --- a/main/src/addins/MonoDevelop.HexEditor/MonoDevelop.HexEditor/HexEditorView.cs +++ b/main/src/addins/MonoDevelop.HexEditor/MonoDevelop.HexEditor/HexEditorView.cs @@ -67,11 +67,11 @@ namespace MonoDevelop.HexEditor public override void Save (string fileName) { - File.WriteAllBytes (fileName, hexEditor.HexEditorData.Buffer.Bytes); + File.WriteAllBytes (fileName, hexEditor.HexEditorData.Bytes); ContentName = fileName; this.IsDirty = false; } - + public override void Load (string fileName) { using (Stream stream = File.OpenRead (fileName)) { |