本文整理汇总了C#中Mono.Debugging.Client.ObjectValue.GetRawValue方法的典型用法代码示例。如果您正苦于以下问题:C# ObjectValue.GetRawValue方法的具体用法?C# ObjectValue.GetRawValue怎么用?C# ObjectValue.GetRawValue使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Mono.Debugging.Client.ObjectValue
的用法示例。
在下文中一共展示了ObjectValue.GetRawValue方法的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GetVisualizerWidget
public override Gtk.Widget GetVisualizerWidget (ObjectValue val)
{
var ops = DebuggingService.DebuggerSession.EvaluationOptions.Clone ();
string file = Path.GetTempFileName ();
Gdk.Pixbuf pixbuf;
ops.AllowTargetInvoke = true;
try {
var pix = (RawValue) val.GetRawValue (ops);
pix.CallMethod ("Save", file, "png");
pixbuf = new Gdk.Pixbuf (file);
} finally {
File.Delete (file);
}
var sc = new Gtk.ScrolledWindow ();
sc.ShadowType = Gtk.ShadowType.In;
sc.HscrollbarPolicy = Gtk.PolicyType.Automatic;
sc.VscrollbarPolicy = Gtk.PolicyType.Automatic;
var image = new Gtk.Image (pixbuf);
sc.AddWithViewport (image);
sc.ShowAll ();
return sc;
}
示例2: GetVisualizerWidget
public override Gtk.Widget GetVisualizerWidget (ObjectValue val)
{
Gdk.Pixbuf pixbuf;
string file = Path.GetTempFileName ();
try {
RawValue pix = (RawValue) val.GetRawValue ();
pix.CallMethod ("Save", file, "png");
pixbuf = new Gdk.Pixbuf (file);
} finally {
File.Delete (file);
}
Gtk.ScrolledWindow sc = new Gtk.ScrolledWindow ();
sc.ShadowType = Gtk.ShadowType.In;
sc.HscrollbarPolicy = Gtk.PolicyType.Automatic;
sc.VscrollbarPolicy = Gtk.PolicyType.Automatic;
Gtk.Image image = new Gtk.Image (pixbuf);
sc.AddWithViewport (image);
sc.ShowAll ();
return sc;
}
示例3: GetVisualizerWidget
public Gtk.Widget GetVisualizerWidget (ObjectValue val)
{
VBox box = new VBox (false, 6);
textView = new TextView ();
textView.Buffer.Text = val.GetRawValue () as string;
textView.WrapMode = WrapMode.Char;
Gtk.ScrolledWindow scrolled = new Gtk.ScrolledWindow ();
scrolled.HscrollbarPolicy = PolicyType.Automatic;
scrolled.VscrollbarPolicy = PolicyType.Automatic;
scrolled.ShadowType = ShadowType.In;
scrolled.Add (textView);
box.PackStart (scrolled, true, true, 0);
CheckButton cb = new CheckButton (GettextCatalog.GetString ("Wrap text"));
cb.Active = true;
cb.Toggled += delegate {
if (cb.Active)
textView.WrapMode = WrapMode.Char;
else
textView.WrapMode = WrapMode.None;
};
box.PackStart (cb, false, false, 0);
box.ShowAll ();
return box;
}
示例4: PopulateTextView
void PopulateTextView (ObjectValue value)
{
var ops = DebuggingService.DebuggerSession.EvaluationOptions.Clone ();
ops.ChunkRawStrings = true;
if (value.TypeName == "string") {
rawString = value.GetRawValue (ops) as RawValueString;
length = rawString.Length;
offset = 0;
if (length > 0) {
idle_id = GLib.Idle.Add (GetNextStringChunk);
textView.Destroyed += delegate {
if (idle_id != 0) {
GLib.Source.Remove (idle_id);
idle_id = 0;
}
};
}
} else if (value.TypeName == "char[]") {
rawArray = value.GetRawValue () as RawValueArray;
length = rawArray.Length;
offset = 0;
if (length > 0) {
idle_id = GLib.Idle.Add (GetNextCharArrayChunk);
textView.Destroyed += delegate {
if (idle_id != 0) {
GLib.Source.Remove (idle_id);
idle_id = 0;
}
};
}
}
}
示例5: GetVisualizerWidget
public override Widget GetVisualizerWidget (ObjectValue val)
{
hexEditor = new Mono.MHex.HexEditor ();
IBuffer buffer = null;
if (val.TypeName != "string") {
var raw = (RawValueArray) val.GetRawValue ();
switch (val.TypeName) {
case "sbyte[]":
buffer = new RawSByteArrayBuffer (raw);
break;
case "char[]":
buffer = new RawCharArrayBuffer (raw);
break;
case "byte[]":
buffer = new RawByteArrayBuffer (raw);
break;
}
} else {
var ops = DebuggingService.DebuggerSession.EvaluationOptions.Clone ();
ops.ChunkRawStrings = true;
buffer = new RawStringBuffer ((RawValueString) val.GetRawValue (ops));
}
hexEditor.HexEditorData.Buffer = buffer;
hexEditor.Sensitive = CanEdit (val);
var xwtScrollView = new Xwt.ScrollView (hexEditor);
var scrollWidget = (Widget) Xwt.Toolkit.CurrentEngine.GetNativeWidget (xwtScrollView);
SetHexEditorOptions ();
hexEditor.SetFocus ();
return scrollWidget;
}
示例6: GetVisualizerWidget
public override Widget GetVisualizerWidget (ObjectValue val)
{
var options = DebuggingService.DebuggerSession.EvaluationOptions.Clone ();
options.AllowTargetInvoke = true;
options.ChunkRawStrings = true;
hexEditor = new Mono.MHex.HexEditorDebugger ();
RawValueString rawString;
RawValueArray rawArray;
IBuffer buffer = null;
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 (rawArray);
break;
case "char[]":
buffer = new RawCharArrayBuffer (rawArray);
break;
case "byte[]":
buffer = new RawByteArrayBuffer (rawArray);
break;
}
break;
}
hexEditor.HexEditorData.Buffer = buffer;
hexEditor.Editor.Sensitive = CanEdit (val);
var xwtScrollView = new Xwt.ScrollView (hexEditor);
var scrollWidget = (Widget) Xwt.Toolkit.CurrentEngine.GetNativeWidget (xwtScrollView);
SetHexEditorOptions ();
hexEditor.SetFocus ();
return scrollWidget;
}
示例7: PopulateTextView
void PopulateTextView (ObjectValue value)
{
var array = value.GetRawValue () as RawValueArray;
var iter = textView.Buffer.EndIter;
string text;
switch (value.TypeName) {
case "sbyte[]":
text = SByteArrayToCString (array.ToArray () as sbyte[]);
break;
case "byte[]":
text = ByteArrayToCString (array.ToArray () as byte[]);
break;
default:
text = string.Empty;
break;
}
textView.Buffer.Insert (ref iter, text);
}
示例8: GetString
string GetString (ObjectValue val)
{
var ops = DebuggingService.DebuggerSession.EvaluationOptions.Clone ();
ops.AllowTargetInvoke = true;
ops.ChunkRawStrings = true;
if (val.TypeName == "string") {
var rawString = val.GetRawValue (ops) as RawValueString;
var length = rawString.Length;
if (length > 0) {
return rawString.Substring (0, Math.Min (length, 4096));
} else {
return "";
}
} else if (val.TypeName == "char[]") {
var rawArray = val.GetRawValue (ops) as RawValueArray;
var length = rawArray.Length;
if (length > 0) {
return new string (rawArray.GetValues (0, Math.Min (length, 4096)) as char[]);
} else {
return "";
}
} else {
throw new InvalidOperationException ();
}
}
示例9: PopulateTextView
void PopulateTextView (ObjectValue value)
{
var session = DebuggingService.DebuggerSession;
var ops = session.EvaluationOptions.Clone ();
ops.AllowTargetInvoke = true;
switch (value.TypeName) {
case "MonoTouch.Foundation.NSData":
case "MonoMac.Foundation.NSData":
case "System.IO.MemoryStream":
case "Foundation.NSData":
var stream = value.GetRawValue (ops) as RawValue;
rawArray = stream.CallMethod ("ToArray") as RawValueArray;
break;
default:
rawArray = value.GetRawValue (ops) as RawValueArray;
break;
}
length = rawArray.Length;
offset = 0;
if (length > 0) {
switch (value.TypeName) {
case "sbyte[]":
idle_id = GLib.Idle.Add (GetNextSByteArrayChunk);
break;
case "MonoTouch.Foundation.NSData":
case "MonoMac.Foundation.NSData":
case "System.IO.MemoryStream":
case "Foundation.NSData":
case "byte[]":
idle_id = GLib.Idle.Add (GetNextByteArrayChunk);
break;
default:
return;
}
textView.Destroyed += delegate {
if (idle_id != 0) {
GLib.Source.Remove (idle_id);
idle_id = 0;
}
};
}
}
示例10: GetVisualizerWidget
public Gtk.Widget GetVisualizerWidget (ObjectValue val)
{
VBox box = new VBox (false, 6);
textView = new TextView () { WrapMode = WrapMode.Char };
Gtk.ScrolledWindow scrolled = new Gtk.ScrolledWindow ();
scrolled.HscrollbarPolicy = PolicyType.Automatic;
scrolled.VscrollbarPolicy = PolicyType.Automatic;
scrolled.ShadowType = ShadowType.In;
scrolled.Add (textView);
box.PackStart (scrolled, true, true, 0);
CheckButton cb = new CheckButton (GettextCatalog.GetString ("Wrap text"));
cb.Active = true;
cb.Toggled += delegate {
if (cb.Active)
textView.WrapMode = WrapMode.Char;
else
textView.WrapMode = WrapMode.None;
};
box.PackStart (cb, false, false, 0);
box.ShowAll ();
EvaluationOptions ops = DebuggingService.DebuggerSession.EvaluationOptions.Clone ();
ops.ChunkRawStrings = true;
this.raw = val.GetRawValue (ops) as RawValueString;
this.length = raw.Length;
this.offset = 0;
this.val = val;
if (this.length > 0) {
idle_id = GLib.Idle.Add (GetNextStringChunk);
textView.Destroyed += delegate {
if (idle_id != 0) {
GLib.Source.Remove (idle_id);
idle_id = 0;
}
};
}
return box;
}
示例11: PopulateTextView
void PopulateTextView (ObjectValue value)
{
rawArray = value.GetRawValue () as RawValueArray;
length = rawArray.Length;
offset = 0;
if (length > 0) {
switch (value.TypeName) {
case "sbyte[]":
idle_id = GLib.Idle.Add (GetNextSByteArrayChunk);
break;
case "byte[]":
idle_id = GLib.Idle.Add (GetNextByteArrayChunk);
break;
default:
return;
}
textView.Destroyed += delegate {
if (idle_id != 0) {
GLib.Source.Remove (idle_id);
idle_id = 0;
}
};
}
}
示例12: GetVisualizerWidget
public override Widget GetVisualizerWidget (ObjectValue val)
{
hexEditor = new Mono.MHex.HexEditor ();
byte[] buf = null;
if (val.TypeName != "string") {
var raw = val.GetRawValue () as RawValueArray;
sbyte[] sbuf;
switch (val.TypeName) {
case "sbyte[]":
sbuf = raw.ToArray () as sbyte[];
buf = new byte[sbuf.Length];
for (int i = 0; i < sbuf.Length; i++)
buf[i] = (byte) sbuf[i];
break;
case "char[]":
buf = Encoding.Unicode.GetBytes (new string (raw.ToArray () as char[]));
break;
case "byte[]":
buf = raw.ToArray () as byte[];
break;
}
} else {
var ops = DebuggingService.DebuggerSession.EvaluationOptions.Clone ();
ops.ChunkRawStrings = true;
var raw = val.GetRawValue (ops) as RawValueString;
buf = Encoding.Unicode.GetBytes (raw.Value);
}
hexEditor.HexEditorData.Buffer = new ArrayBuffer (buf);
hexEditor.Sensitive = CanEdit (val);
var xwtScrollView = new Xwt.ScrollView (hexEditor);
var scrollWidget = (Widget) Xwt.Toolkit.CurrentEngine.GetNativeWidget (xwtScrollView);
SetHexEditorOptions ();
hexEditor.SetFocus ();
return scrollWidget;
}
示例13: PopulateTextView
void PopulateTextView (ObjectValue value)
{
var ops = DebuggingService.DebuggerSession.EvaluationOptions.Clone ();
ops.AllowTargetInvoke = true;
rawArray = value.GetRawValue (ops) as RawValueArray;
length = rawArray.Length;
offset = 0;
if (length > 0) {
switch (value.TypeName) {
case "sbyte[]":
idle_id = GLib.Idle.Add (GetNextSByteArrayChunk);
break;
case "byte[]":
idle_id = GLib.Idle.Add (GetNextByteArrayChunk);
break;
default:
return;
}
textView.Destroyed += delegate {
if (idle_id != 0) {
GLib.Source.Remove (idle_id);
idle_id = 0;
}
};
}
}