diff options
author | Mike Krüger <mkrueger@xamarin.com> | 2015-03-24 20:19:10 +0300 |
---|---|---|
committer | Mike Krüger <mkrueger@xamarin.com> | 2015-03-24 20:19:10 +0300 |
commit | 8b9f26155b5bfcecad034bd28212823f6f49ed7f (patch) | |
tree | acad49cc13939a5c2e50812b99c98b1aa8a41c84 /main/src/addins/MonoDevelop.HexEditor | |
parent | 03e211d6f04a3c7d7a4325c82c667c68f9950bf1 (diff) | |
parent | 6b41c028b3e3cafa6f95f4aa9bbc6b28924b893e (diff) |
Merge branch 'master' into roslyn
Conflicts:
main/external/fsharpbinding
main/src/addins/CSharpBinding/MonoDevelop.CSharp.Parser/TypeSystemProvider.cs
main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor.QuickTasks/QuickTaskStrip.cs
main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/DebugValueWindow.cs
main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Commands/CommandManager.cs
main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/Document.cs
main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/WorkbenchWindow.cs
version-checks
Diffstat (limited to 'main/src/addins/MonoDevelop.HexEditor')
-rw-r--r-- | main/src/addins/MonoDevelop.HexEditor/MonoDevelop.HexEditor/HexEditorVisualizer.cs | 65 |
1 files changed, 42 insertions, 23 deletions
diff --git a/main/src/addins/MonoDevelop.HexEditor/MonoDevelop.HexEditor/HexEditorVisualizer.cs b/main/src/addins/MonoDevelop.HexEditor/MonoDevelop.HexEditor/HexEditorVisualizer.cs index e0410e2c30..7897809fdd 100644 --- a/main/src/addins/MonoDevelop.HexEditor/MonoDevelop.HexEditor/HexEditorVisualizer.cs +++ b/main/src/addins/MonoDevelop.HexEditor/MonoDevelop.HexEditor/HexEditorVisualizer.cs @@ -49,27 +49,35 @@ 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; - case "char[]": return true; - case "string": return true; - default: return false; + case "MonoTouch.Foundation.NSData": + case "MonoMac.Foundation.NSData": + case "System.IO.MemoryStream": + case "Foundation.NSData": + case "sbyte[]": + case "byte[]": + case "char[]": + case "string": + return true; + default: + return false; } } public override bool IsDefaultVisualizer (ObjectValue val) { - if (val.TypeName != null && val.TypeName.EndsWith ("Foundation.NSData")) - return true; switch (val.TypeName) { + case "MonoTouch.Foundation.NSData": + case "MonoMac.Foundation.NSData": + case "System.IO.MemoryStream": + case "Foundation.NSData": case "sbyte[]": - case "byte[]": return true; + case "byte[]": + return true; case "char[]": - case "string": return false; - default: return false; + case "string": + default: + return false; } } @@ -86,28 +94,39 @@ namespace MonoDevelop.HexEditor options.AllowTargetInvoke = true; options.ChunkRawStrings = true; - IBuffer buffer = null; hexEditor = new Mono.MHex.HexEditorDebugger (); + RawValueString rawString; + RawValueArray rawArray; + IBuffer buffer = null; - 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 (options); + switch (val.TypeName) { + case "MonoTouch.Foundation.NSData": + case "MonoMac.Foundation.NSData": + case "System.IO.MemoryStream": + case "Foundation.NSData": + var stream = (RawValue) val.GetRawValue (options); + rawArray = (RawValueArray) stream.CallMethod ("ToArray"); + buffer = new RawByteArrayBuffer (rawArray); + break; + case "string": + rawString = (RawValueString) val.GetRawValue (options); + buffer = new RawStringBuffer (rawString); + break; + default: + rawArray = (RawValueArray) val.GetRawValue (options); switch (val.TypeName) { case "sbyte[]": - buffer = new RawSByteArrayBuffer (raw); + buffer = new RawSByteArrayBuffer (rawArray); break; case "char[]": - buffer = new RawCharArrayBuffer (raw); + buffer = new RawCharArrayBuffer (rawArray); break; case "byte[]": - buffer = new RawByteArrayBuffer (raw); + buffer = new RawByteArrayBuffer (rawArray); break; } - } else { - buffer = new RawStringBuffer ((RawValueString)val.GetRawValue (options)); + break; } hexEditor.HexEditorData.Buffer = buffer; |