BindingFlags.Public needed here as Exception.HResult is now public in .NET 4.5. This...
[mono.git] / mcs / class / Mono.Debugger.Soft / Mono.Debugger.Soft / PrimitiveValue.cs
1 using System;
2 using System.Collections.Generic;
3
4 namespace Mono.Debugger.Soft
5 {
6         /*
7          * Represents a value of a primitive type in the debuggee
8          */
9         public class PrimitiveValue : Value {
10
11                 object value;
12
13                 public PrimitiveValue (VirtualMachine vm, object value) : base (vm, 0) {
14                         this.value = value;
15                 }
16
17                 public object Value {
18                         get {
19                                 return value;
20                         }
21                 }
22
23                 public override bool Equals (object obj) {
24                         if (value == obj)
25                                 return true;
26                         if (obj != null && obj is PrimitiveValue)
27                                 return value == (obj as PrimitiveValue).Value;
28                         return base.Equals (obj);
29                 }
30
31                 public override int GetHashCode () {
32                         return base.GetHashCode ();
33                 }
34
35                 public override string ToString () {
36                         return "PrimitiveValue<" + Value + ">";
37                 }
38
39                 public Value InvokeMethod (ThreadMirror thread, MethodMirror method, IList<Value> arguments) {
40                         return ObjectMirror.InvokeMethod (vm, thread, method, this, arguments, InvokeOptions.None);
41                 }
42
43                 public Value InvokeMethod (ThreadMirror thread, MethodMirror method, IList<Value> arguments, InvokeOptions options) {
44                         return ObjectMirror.InvokeMethod (vm, thread, method, this, arguments, options);
45                 }
46
47                 public IAsyncResult BeginInvokeMethod (ThreadMirror thread, MethodMirror method, IList<Value> arguments, InvokeOptions options, AsyncCallback callback, object state) {
48                         return ObjectMirror.BeginInvokeMethod (vm, thread, method, this, arguments, options, callback, state);
49                 }
50
51                 public Value EndInvokeMethod (IAsyncResult asyncResult) {
52                         return ObjectMirror.EndInvokeMethodInternal (asyncResult);
53                 }
54         }
55 }