本文整理汇总了C#中Interpreter.Init方法的典型用法代码示例。如果您正苦于以下问题:C# Interpreter.Init方法的具体用法?C# Interpreter.Init怎么用?C# Interpreter.Init使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Interpreter
的用法示例。
在下文中一共展示了Interpreter.Init方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Run
protected override void Run()
{
var interpreter = new Interpreter();
interpreter.Init( Engine.ServiceProvider );
// just register it so that it can be cleaned up later
Engine.ServiceProvider.RegisterService( interpreter.GetType(), interpreter );
interpreter.Start( Variables );
Interpret();
}
示例2: OnStartUp
private void OnStartUp( object sender, StartupEventArgs e )
{
var application = e.Args.Length > 0 ? e.Args[ 0 ] : null;
Engine.Boot( application );
Engine.Run();
var interpreter = new Interpreter();
interpreter.Init( Engine.ServiceProvider );
// just register it so that it can be cleaned up later
Engine.ServiceProvider.RegisterService( interpreter.GetType(), interpreter );
interpreter.Start();
}
示例3: SetUp
public override void SetUp()
{
base.SetUp();
myDataAccess = myMockery.NewMock<IDatabaseSC>();
myServiceProvider = Engine.ServiceProvider;
myServiceProvider.RegisterService( "TOM Database", myDataAccess );
myServiceProvider.RegisterService( typeof( IEntityRepositoryFactory ), new FakeEntityRepositoryFactory() );
myServiceProvider.ConfigurationSC().Import( Path.Combine( MauiHome, "config" ), true );
ScriptingInterface tomScripting = new ScriptingInterface();
tomScripting.Init( myServiceProvider );
myServiceProvider.RegisterService( typeof( ScriptingInterface ), tomScripting );
myInterpreter = new Interpreter();
myInterpreter.Init( myServiceProvider );
//myInterpreter.DumpErrorToConsole = true;
myInterpreter.Start();
}