Jo Shields fe777c5c82 Imported Upstream version 3.8.0
Former-commit-id: 6a76a29bd07d86e57c6c8da45c65ed5447d38a61
2014-09-04 09:07:35 +01:00

63 lines
1.7 KiB
C#

using System;
using System.Collections.Generic;
namespace Mono.Debugger.Soft
{
/*
* Represents a value of a primitive type in the debuggee
*/
public class PrimitiveValue : Value {
object value;
public PrimitiveValue (VirtualMachine vm, object value) : base (vm, 0) {
this.value = value;
}
public object Value {
get {
return value;
}
}
public override bool Equals (object obj) {
if (value == obj)
return true;
var primitive = obj as PrimitiveValue;
if (primitive != null)
return value == primitive.Value;
return base.Equals (obj);
}
public override int GetHashCode () {
return base.GetHashCode ();
}
public override string ToString () {
object v = Value;
return "PrimitiveValue<" + (v != null ? v.ToString () : "(null)") + ">";
}
public Value InvokeMethod (ThreadMirror thread, MethodMirror method, IList<Value> arguments) {
return ObjectMirror.InvokeMethod (vm, thread, method, this, arguments, InvokeOptions.None);
}
public Value InvokeMethod (ThreadMirror thread, MethodMirror method, IList<Value> arguments, InvokeOptions options) {
return ObjectMirror.InvokeMethod (vm, thread, method, this, arguments, options);
}
public IAsyncResult BeginInvokeMethod (ThreadMirror thread, MethodMirror method, IList<Value> arguments, InvokeOptions options, AsyncCallback callback, object state) {
return ObjectMirror.BeginInvokeMethod (vm, thread, method, this, arguments, options, callback, state);
}
public Value EndInvokeMethod (IAsyncResult asyncResult) {
return ObjectMirror.EndInvokeMethodInternal (asyncResult);
}
public InvokeResult EndInvokeMethodWithResult (IAsyncResult asyncResult) {
return ObjectMirror.EndInvokeMethodInternalWithResult (asyncResult);
}
}
}