1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62
|
using System;
using System.Runtime.Serialization;
using System.Xml;
namespace Mono.Debugger
{
public class Display : DebuggerMarshalByRefObject
{
public DebuggerSession Session {
get { return session; }
}
public int Index {
get { return index; }
}
public string Text {
get { return text; }
}
public bool IsEnabled {
get { return enabled; }
set { enabled = value; }
}
//
// Session handling.
//
internal void GetSessionData (XmlElement root)
{
XmlElement element = root.OwnerDocument.CreateElement ("Display");
root.AppendChild (element);
element.SetAttribute ("index", index.ToString ());
element.SetAttribute ("enabled", enabled ? "true" : "false");
element.SetAttribute ("text", text);
}
//
// Everything below is private.
//
static int next_index = 0;
private readonly DebuggerSession session;
private readonly string text;
private readonly int index;
bool enabled = true;
internal Display (DebuggerSession session, int index, bool enabled, string text)
{
this.session = session;
this.index = index;
this.enabled = enabled;
this.text = text;
}
internal Display (DebuggerSession session, string text)
: this (session, ++next_index, true, text)
{ }
}
}
|