Menu

[r4]: / Basic-Debugger / BasicProject.cs  Maximize  Restore  History

Download this file

154 lines (129 with data), 3.2 kB

  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
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
using System;
using System.Collections.Generic;
using System.Text;
namespace Basic_Debugger
{
/// <summary>
/// Project class containing all code and subs
/// </summary>
public class BasicProject
{
/// <summary>
/// Initialize a new instance of BasicProject
/// </summary>
public BasicProject()
{
_debugger = new Debugger(this);
_code = new Code();
}
string _location;
string _name;
Debugger _debugger;
Code _code;
/// <summary>
/// Run current project
/// </summary>
public bool Run(bool monitor)
{
//return _debugger.Check(out errorLines);
return true;
}
public string Location
{
get { return _location; }
set { _location = value; }
}
public string Name
{
get { return _name; }
set { _name = value; }
}
public Debugger Debugger
{
get { return _debugger; }
}
public Code Code
{
get { return _code; }
set { _code = value; }
}
public void Save()
{
}
}
public class Code
{
public Code()
{
_main = "";
_subs = new Subs();
}
private string _main;
private Subs _subs;
public string MainCode
{
get { return _main; }
set { _main = value; }
}
public Subs Subs
{
get { return _subs; }
}
}
public class Subs : List<Sub>
{
public event EventHandler OnLibraryChange;
public Subs()
: base()
{
}
/// <summary>
/// Return a specified sub by name, null if not found
/// </summary>
/// <param name="bla">The name of the sub code to searh for</param>
/// <returns>the whole sub item</returns>
public Sub this[string name]
{
get
{
for (int I = 0; I < this.Count; I++)
{
if (this[I].Name == name)
return this[I];
}
return null;
}
}
public void AddItem(Sub item)
{
base.Add(item);
if (OnLibraryChange != null)
OnLibraryChange(null, null);
}
public void AddRange(Sub[] items)
{
}
}
public class Sub
{
public Sub()
{
}
public Sub(string name)
{
_name = name;
}
string _content;
string _name;
public string Content
{
get { return _content; }
set { _content = value; }
}
public string Name
{
get { return _name; }
set { _name = value; }
}
}
}
MongoDB Logo MongoDB