diff --git a/src/AddIns/DisplayBindings/HexEditor/Project/Src/Editor.cs b/src/AddIns/DisplayBindings/HexEditor/Project/Src/Editor.cs
index e0ca39d8f4..cb50cd84c5 100644
--- a/src/AddIns/DisplayBindings/HexEditor/Project/Src/Editor.cs
+++ b/src/AddIns/DisplayBindings/HexEditor/Project/Src/Editor.cs
@@ -5,6 +5,7 @@
// $Revision$
//
+using ICSharpCode.Core;
using System;
using System.Collections;
using System.ComponentModel;
@@ -13,7 +14,6 @@ using System.IO;
using System.Text;
using System.Windows.Forms;
using System.Xml;
-
using HexEditor.Util;
using ICSharpCode.SharpDevelop;
@@ -123,7 +123,7 @@ namespace HexEditor
///
public void LoadSettings()
{
- string configpath = Path.GetDirectoryName(typeof(Editor).Assembly.Location) + Path.DirectorySeparatorChar + "config.xml";
+ string configpath = Path.Combine(PropertyService.ConfigDirectory, "hexeditor-config.xml");
if (!File.Exists(configpath)) {
this.settings = Settings.CreateDefault();
diff --git a/src/AddIns/DisplayBindings/HexEditor/Project/Src/Util/BufferManager.cs b/src/AddIns/DisplayBindings/HexEditor/Project/Src/Util/BufferManager.cs
index 9f0dd3d5c5..201a3250c7 100644
--- a/src/AddIns/DisplayBindings/HexEditor/Project/Src/Util/BufferManager.cs
+++ b/src/AddIns/DisplayBindings/HexEditor/Project/Src/Util/BufferManager.cs
@@ -6,7 +6,7 @@
//
using System;
-using System.Collections;
+using System.Collections.Generic;
using System.IO;
using System.Windows.Forms;
@@ -27,7 +27,7 @@ namespace HexEditor.Util
///
/// Currently used, but not good for really big files (like 590 MB)
///
- private ArrayList buffer;
+ List buffer;
///
/// Creates a new BufferManager and attaches it to a control.
@@ -37,7 +37,7 @@ namespace HexEditor.Util
{
this.parent = parent;
- this.buffer = new ArrayList();
+ this.buffer = new List();
}
///
@@ -102,7 +102,7 @@ namespace HexEditor.Util
public void Save(OpenedFile file, Stream stream)
{
BinaryWriter writer = new BinaryWriter(stream);
- writer.Write((byte[])this.buffer.ToArray( typeof (byte) ));
+ writer.Write(this.buffer.ToArray());
writer.Flush();
}
@@ -141,7 +141,7 @@ namespace HexEditor.Util
public byte[] Buffer {
get {
if (buffer == null) return new byte[0];
- return (byte[]) buffer.ToArray( typeof ( byte ) );
+ return buffer.ToArray();
}
}
@@ -161,7 +161,7 @@ namespace HexEditor.Util
if (start >= buffer.Count) start = buffer.Count;
if (count < 1) count = 1;
if (count >= (buffer.Count - start)) count = (buffer.Count - start);
- return (byte[])(buffer.GetRange(start, count).ToArray( typeof ( byte ) ));
+ return buffer.GetRange(start, count).ToArray();
}
public byte GetByte(int offset)
@@ -199,12 +199,12 @@ namespace HexEditor.Util
return false;
}
- /// Not Tested!
public void SetBytes(int start, byte[] bytes, bool overwrite)
{
if (overwrite) {
if (bytes.Length > buffer.Count) buffer.AddRange(new byte[bytes.Length - buffer.Count]);
- buffer.SetRange(start, bytes);
+ for (int i = start; i < start + bytes.Length; i++)
+ buffer[i] = bytes[i - start];
} else {
buffer.InsertRange(start, bytes);
}
diff --git a/src/AddIns/DisplayBindings/HexEditor/Project/Src/View/HexEditDisplayBinding.cs b/src/AddIns/DisplayBindings/HexEditor/Project/Src/View/HexEditDisplayBinding.cs
index 15657d59ef..2a6423486a 100644
--- a/src/AddIns/DisplayBindings/HexEditor/Project/Src/View/HexEditDisplayBinding.cs
+++ b/src/AddIns/DisplayBindings/HexEditor/Project/Src/View/HexEditDisplayBinding.cs
@@ -43,7 +43,7 @@ namespace HexEditor.View
{
if (supportedExtensions == null) {
System.Xml.XmlDocument doc = new System.Xml.XmlDocument();
- string configpath = Path.GetDirectoryName(typeof(Editor).Assembly.Location) + Path.DirectorySeparatorChar + "config.xml";
+ string configpath = Path.Combine(PropertyService.ConfigDirectory, "hexeditor-config.xml");
if (!File.Exists(configpath))
return new string[] {".exe",".dll"};
diff --git a/src/AddIns/DisplayBindings/HexEditor/Project/Src/View/HexEditOptionsPanel.cs b/src/AddIns/DisplayBindings/HexEditor/Project/Src/View/HexEditOptionsPanel.cs
index 280040babc..fd1586d33d 100644
--- a/src/AddIns/DisplayBindings/HexEditor/Project/Src/View/HexEditOptionsPanel.cs
+++ b/src/AddIns/DisplayBindings/HexEditor/Project/Src/View/HexEditOptionsPanel.cs
@@ -62,7 +62,7 @@ namespace HexEditor.View
{
SetupFromXmlStream(this.GetType().Assembly.GetManifestResourceStream("HexEditor.Resources.HexEditOptions.xfrm"));
this.InitializeComponents();
- string configpath = Path.GetDirectoryName(typeof(Editor).Assembly.Location) + Path.DirectorySeparatorChar + "config.xml";
+ string configpath = Path.Combine(PropertyService.ConfigDirectory, "hexeditor-config.xml");
if (!File.Exists(configpath)) return;
@@ -140,7 +140,7 @@ namespace HexEditor.View
public override bool StorePanelContents()
{
- string configpath = Path.GetDirectoryName(typeof(Editor).Assembly.Location) + Path.DirectorySeparatorChar + "config.xml";
+ string configpath = Path.Combine(PropertyService.ConfigDirectory, "hexeditor-config.xml");
XmlDocument file = new XmlDocument();
file.LoadXml("");