本文整理汇总了C#中IScriptEngine类的典型用法代码示例。如果您正苦于以下问题:C# IScriptEngine类的具体用法?C# IScriptEngine怎么用?C# IScriptEngine使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
IScriptEngine类属于命名空间,在下文中一共展示了IScriptEngine类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ScriptCSSession
ScriptCSSession( IScriptEngine engine, ScriptPackSession scriptPackSession, CurrentCmdletScriptPack currentCmdletScriptPack, CurrentLogger logger)
{
_engine = engine;
_scriptPackSession = scriptPackSession;
_currentCmdletScriptPack = currentCmdletScriptPack;
_logger = logger;
}
示例2: Camera
public Camera(IScriptEngine scriptEngine, IApplicationContext context)
{
_scriptEngine = scriptEngine;
_context = context;
Size = 200;
}
示例3: FileSystem
public FileSystem(IScriptEngine scriptEngine, IApplicationContext io)
{
_scriptEngine = scriptEngine;
_io = io;
ReadFsLog();
}
示例4: ExecuteScript
private CalamariResult ExecuteScript(IScriptEngine psse, string scriptName, CalamariVariableDictionary variables)
{
var capture = new CaptureCommandOutput();
var runner = new CommandLineRunner(capture);
var result = psse.Execute(scriptName, variables, runner);
return new CalamariResult(result.ExitCode, capture);
}
示例5: ScriptServices
public ScriptServices(
IFileSystem fileSystem,
IPackageAssemblyResolver packageAssemblyResolver,
IScriptExecutor executor,
IScriptEngine engine,
IFilePreProcessor filePreProcessor,
IReplCommandService replCommandService,
IScriptPackResolver scriptPackResolver,
IPackageInstaller packageInstaller,
ILog logger,
IAssemblyResolver assemblyResolver,
IConsole console = null,
IInstallationProvider installationProvider = null
)
{
FileSystem = fileSystem;
PackageAssemblyResolver = packageAssemblyResolver;
Executor = executor;
Engine = engine;
FilePreProcessor = filePreProcessor;
ReplCommandService = replCommandService;
ScriptPackResolver = scriptPackResolver;
PackageInstaller = packageInstaller;
Logger = logger;
Console = console;
AssemblyResolver = assemblyResolver;
InstallationProvider = installationProvider;
}
示例6: Web
public Web(IScriptEngine engine, IWebProvider provider)
{
Assert.IsNotNull(engine); Assert.IsNotNull(provider);
_scriptEngine = engine;
_provider = provider;
}
示例7: Gallery
public Gallery(IApplicationContext context, IScriptEngine engine)
{
_context = context;
_scriptEngine = engine;
Size = 200;
}
示例8: ScriptExecutor
public ScriptExecutor(
IFileSystem fileSystem,
IFilePreProcessor filePreProcessor,
IScriptEngine scriptEngine,
ILogProvider logProvider,
IScriptLibraryComposer composer)
{
Guard.AgainstNullArgument("fileSystem", fileSystem);
Guard.AgainstNullArgumentProperty("fileSystem", "BinFolder", fileSystem.BinFolder);
Guard.AgainstNullArgumentProperty("fileSystem", "DllCacheFolder", fileSystem.DllCacheFolder);
Guard.AgainstNullArgument("filePreProcessor", filePreProcessor);
Guard.AgainstNullArgument("scriptEngine", scriptEngine);
Guard.AgainstNullArgument("logProvider", logProvider);
Guard.AgainstNullArgument("composer", composer);
References = new AssemblyReferences(DefaultReferences);
Namespaces = new Collection<string>();
ImportNamespaces(DefaultNamespaces);
FileSystem = fileSystem;
FilePreProcessor = filePreProcessor;
ScriptEngine = scriptEngine;
_log = logProvider.ForCurrentType();
#pragma warning disable 618
Logger = new ScriptCsLogger(_log);
#pragma warning restore 618
ScriptLibraryComposer = composer;
}
示例9: ScriptServices
public ScriptServices(
IFileSystem fileSystem,
IPackageAssemblyResolver packageAssemblyResolver,
IScriptExecutor executor,
IRepl repl,
IScriptEngine engine,
IFilePreProcessor filePreProcessor,
IScriptPackResolver scriptPackResolver,
IPackageInstaller packageInstaller,
IObjectSerializer objectSerializer,
ILog logger,
IAssemblyResolver assemblyResolver,
IEnumerable<IReplCommand> replCommands,
IConsole console = null,
IInstallationProvider installationProvider = null)
{
FileSystem = fileSystem;
PackageAssemblyResolver = packageAssemblyResolver;
Executor = executor;
Repl = repl;
Engine = engine;
FilePreProcessor = filePreProcessor;
ScriptPackResolver = scriptPackResolver;
PackageInstaller = packageInstaller;
ObjectSerializer = objectSerializer;
Logger = logger;
Console = console;
AssemblyResolver = assemblyResolver;
InstallationProvider = installationProvider;
ReplCommands = replCommands;
}
示例10: ExecuteReplCommand
public ExecuteReplCommand(
string scriptName,
string[] scriptArgs,
IFileSystem fileSystem,
IScriptPackResolver scriptPackResolver,
IScriptEngine scriptEngine,
IFilePreProcessor filePreProcessor,
IObjectSerializer serializer,
ILog logger,
IConsole console,
IAssemblyResolver assemblyResolver,
IEnumerable<IReplCommand> replCommands)
{
_scriptName = scriptName;
_scriptArgs = scriptArgs;
_fileSystem = fileSystem;
_scriptPackResolver = scriptPackResolver;
_scriptEngine = scriptEngine;
_filePreProcessor = filePreProcessor;
_serializer = serializer;
_logger = logger;
_console = console;
_assemblyResolver = assemblyResolver;
_replCommands = replCommands;
}
示例11: Run
/// <summary>
/// Executes the comand line - depending upon the options provided we will
/// either run a single file, a single command, or enter the interactive loop.
/// </summary>
public int Run(IScriptEngine engine, IConsole console, ConsoleOptions options) {
Contract.RequiresNotNull(engine, "engine");
Contract.RequiresNotNull(console, "console");
Contract.RequiresNotNull(options, "options");
_engine = engine;
_options = options;
_console = console;
Initialize();
try {
return Run();
#if !SILVERLIGHT // ThreadAbortException.ExceptionState
} catch (System.Threading.ThreadAbortException tae) {
if (tae.ExceptionState is KeyboardInterruptException) {
Thread.ResetAbort();
}
return -1;
#endif
} finally {
Shutdown(engine);
}
}
示例12: ScriptExecutor
public ScriptExecutor(IFileSystem fileSystem, IFilePreProcessor filePreProcessor, IScriptEngine scriptEngine, ILog logger)
{
FileSystem = fileSystem;
FilePreProcessor = filePreProcessor;
ScriptEngine = scriptEngine;
Logger = logger;
}
示例13: PackagedScriptConvention
public PackagedScriptConvention(string scriptFilePrefix, ICalamariFileSystem fileSystem, IScriptEngine scriptEngine, ICommandLineRunner commandLineRunner)
{
this.scriptFilePrefix = scriptFilePrefix;
this.fileSystem = fileSystem;
this.scriptEngine = scriptEngine;
this.commandLineRunner = commandLineRunner;
}
示例14: DeployAzureCloudServicePackageConvention
public DeployAzureCloudServicePackageConvention(ICalamariFileSystem fileSystem, ICalamariEmbeddedResources embeddedResources,
IScriptEngine scriptEngine, ICommandLineRunner commandLineRunner)
{
this.fileSystem = fileSystem;
this.embeddedResources = embeddedResources;
this.scriptEngine = scriptEngine;
this.commandLineRunner = commandLineRunner;
}
示例15: CreateCore
private RShipCore CreateCore(IScriptEngine engine)
{
var modulesPath = Path.Combine(PathHelpers.GetAssemblyDirectory(), "ship_modules");
var pathResolver = new ModulePathResolver(modulesPath, new[] { ".ship", ".js", ".json", ".dll" }, "lib");
var loaderFactory = new ModuleLoaderFactory();
var core = new RShipCore(engine, pathResolver, loaderFactory);
return core;
}