Esempio n. 1
0
 /// <summary>
 /// Initializes a new instance of the <see cref="CompiledProgramRunner"/> class.
 /// </summary>
 /// <param name="baZicInterpreter">The <see cref="BaZicInterpreterCore"/> that called this class.</param>
 /// <param name="program">The <see cref="BaZicProgram"/> to compile and run.</param>
 /// <param name="assemblySandbox">The sandbox that contains the required assemblies.</param>
 internal CompiledProgramRunner(BaZicInterpreterCore baZicInterpreter, BaZicProgram program, AssemblySandbox assemblySandbox)
 {
     Requires.NotNull(baZicInterpreter, nameof(baZicInterpreter));
     Requires.NotNull(program, nameof(program));
     Requires.NotNull(assemblySandbox, nameof(assemblySandbox));
     _baZicInterpreter = baZicInterpreter;
     _program          = program;
     _assemblySandbox  = assemblySandbox;
 }
Esempio n. 2
0
 /// <summary>
 /// Sends a log to the <see cref="BaZicInterpreter"/>.
 /// </summary>
 /// <param name="sender">The core.</param>
 /// <param name="log">The log.</param>
 internal void SendLog(BaZicInterpreterCore sender, BaZicInterpreterStateChangeEventArgs log)
 {
     _baZicInterpreter.SendLog(log);
 }
Esempio n. 3
0
 /// <summary>
 /// Initializes a new instance of the <see cref="BaZicInterpreter"/> class.
 /// </summary>
 /// <param name="inputCode">The BaZic code to interpret.</param>
 /// <param name="optimize">(optional) Defines whether the generated syntax tree must be optimized for the interpreter or not.</param>
 public BaZicInterpreter(string inputCode, bool optimize = false)
     : this()
 {
     _core = _assemblySandbox.CreateInstanceMarshalByRefObject <BaZicInterpreterCore>(new BaZicInterpreterMiddleware(this), _assemblySandbox, inputCode, string.Empty, new List <string>(), optimize);
 }
Esempio n. 4
0
 /// <summary>
 /// Initializes a new instance of the <see cref="BaZicInterpreter"/> class.
 /// </summary>
 /// <param name="inputCode">The BaZic code to interpret.</param>
 /// <param name="xamlCode">The XAML code to interpret that represents the user interface.</param>
 /// <param name="resourceFilePaths">Paths to the resources files (like PNG or JPG) required for the XAML code.</param>
 /// <param name="optimize">(optional) Defines whether the generated syntax tree must be optimized for the interpreter or not.</param>
 public BaZicInterpreter(string inputCode, string xamlCode, IEnumerable <string> resourceFilePaths = null, bool optimize = false)
     : this()
 {
     _core = _assemblySandbox.CreateInstanceMarshalByRefObject <BaZicInterpreterCore>(new BaZicInterpreterMiddleware(this), _assemblySandbox, inputCode, xamlCode, resourceFilePaths, optimize);
 }
Esempio n. 5
0
 /// <summary>
 /// Initializes a new instance of the <see cref="BaZicInterpreter"/> class.
 /// </summary>
 /// <param name="program">The <see cref="BaZicProgram"/> to interpret.</param>
 public BaZicInterpreter(BaZicProgram program)
     : this()
 {
     _core = _assemblySandbox.CreateInstanceMarshalByRefObject <BaZicInterpreterCore>(new BaZicInterpreterMiddleware(this), _assemblySandbox, program);
 }