本文整理匯總了C#中ProtoCore.RuntimeCore.SetProperties方法的典型用法代碼示例。如果您正苦於以下問題:C# RuntimeCore.SetProperties方法的具體用法?C# RuntimeCore.SetProperties怎麽用?C# RuntimeCore.SetProperties使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類ProtoCore.RuntimeCore
的用法示例。
在下文中一共展示了RuntimeCore.SetProperties方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。
示例1: TestCompilerAndRuntimeComponent01
public void TestCompilerAndRuntimeComponent01()
{
String code =
@"
a = 10;
";
// Compile core
var opts = new Options();
opts.ExecutionMode = ExecutionMode.Serial;
ProtoCore.Core core = new Core(opts);
core.Compilers.Add(ProtoCore.Language.kAssociative, new ProtoAssociative.Compiler(core));
core.Compilers.Add(ProtoCore.Language.kImperative, new ProtoImperative.Compiler(core));
ProtoScriptRunner runner = new ProtoScriptRunner();
// Compiler instance
ProtoCore.DSASM.Executable dsExecutable;
bool compileSucceeded = runner.CompileMe(code, core, out dsExecutable);
Assert.IsTrue(compileSucceeded == true);
// Pass compile data to the runtime
RuntimeCore runtimeCore = new RuntimeCore(core.Heap);
runtimeCore.SetProperties(core.Options, dsExecutable);
// Runtime
ExecutionMirror mirror = runner.ExecuteMe(runtimeCore);
Obj o = mirror.GetValue("a");
示例2: SetUp
public void SetUp()
{
testCore = thisTest.SetupTestCore();
testRuntimeCore = new RuntimeCore(testCore.Heap);
testRuntimeCore.SetProperties(testCore.Options, null);
testExecutive = new TestExecutive(testRuntimeCore);
}