diff options
author | David Karlaš <david.karlas@xamarin.com> | 2014-07-24 16:18:04 +0400 |
---|---|---|
committer | David Karlaš <david.karlas@xamarin.com> | 2014-07-24 16:18:04 +0400 |
commit | 7d56be33f67004ad5fd7724ab5709144f00e6f3a (patch) | |
tree | f8b839c63cb353ba4f961ce872854bde9782353f /main/src/addins/MonoDevelop.HexEditor | |
parent | 5387e8b924b133de586c3ccf754a720a77f84ffb (diff) |
[HexEditor] Support for NSData
Diffstat (limited to 'main/src/addins/MonoDevelop.HexEditor')
-rw-r--r-- | main/src/addins/MonoDevelop.HexEditor/MonoDevelop.HexEditor/HexEditorVisualizer.cs | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/main/src/addins/MonoDevelop.HexEditor/MonoDevelop.HexEditor/HexEditorVisualizer.cs b/main/src/addins/MonoDevelop.HexEditor/MonoDevelop.HexEditor/HexEditorVisualizer.cs index 002444879c..2ffd772aa1 100644 --- a/main/src/addins/MonoDevelop.HexEditor/MonoDevelop.HexEditor/HexEditorVisualizer.cs +++ b/main/src/addins/MonoDevelop.HexEditor/MonoDevelop.HexEditor/HexEditorVisualizer.cs @@ -52,6 +52,8 @@ namespace MonoDevelop.HexEditor public override bool CanVisualize (ObjectValue val) { + if (val.TypeName != null && val.TypeName.EndsWith ("Foundation.NSData")) + return true; switch (val.TypeName) { case "sbyte[]": return true; case "byte[]": return true; @@ -63,6 +65,8 @@ namespace MonoDevelop.HexEditor public override bool IsDefaultVisualizer (ObjectValue val) { + if (val.TypeName != null && val.TypeName.EndsWith ("Foundation.NSData")) + return true; switch (val.TypeName) { case "sbyte[]": case "byte[]": return true; @@ -85,8 +89,11 @@ namespace MonoDevelop.HexEditor IBuffer buffer = null; - if (val.TypeName != "string") { - var raw = (RawValueArray) val.GetRawValue (); + if (val.TypeName != null && val.TypeName.EndsWith ("Foundation.NSData")) { + var raw = (RawValueArray)((RawValue)val.GetRawValue ()).CallMethod ("ToArray"); + buffer = new RawByteArrayBuffer (raw); + } else if (val.TypeName != "string") { + var raw = (RawValueArray)val.GetRawValue (); switch (val.TypeName) { case "sbyte[]": @@ -103,7 +110,7 @@ namespace MonoDevelop.HexEditor var ops = DebuggingService.DebuggerSession.EvaluationOptions.Clone (); ops.ChunkRawStrings = true; - buffer = new RawStringBuffer ((RawValueString) val.GetRawValue (ops)); + buffer = new RawStringBuffer ((RawValueString)val.GetRawValue (ops)); } hexEditor.HexEditorData.Buffer = buffer; |