Class DefaultScriptProcessor
The default script processor.
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Namespace: Kephas.Scripting
Assembly: Kephas.Scripting.dll
Syntax
[OverridePriority(Priority.Low)]
public class DefaultScriptProcessor : Loggable, ILoggable, IScriptProcessor
Constructors
| Improve this Doc View SourceDefaultScriptProcessor(IContextFactory, ICollection<IExportFactory<ILanguageService, LanguageServiceMetadata>>, ICollection<IExportFactory<IScriptingBehavior, ScriptingBehaviorMetadata>>)
Initializes a new instance of the DefaultScriptProcessor class.
Declaration
public DefaultScriptProcessor(IContextFactory contextFactory, ICollection<IExportFactory<ILanguageService, LanguageServiceMetadata>> languageServiceFactories, ICollection<IExportFactory<IScriptingBehavior, ScriptingBehaviorMetadata>> scriptingBehaviorFactories)
Parameters
Type | Name | Description |
---|---|---|
IContextFactory | contextFactory | The context factory. |
System.Collections.Generic.ICollection<IExportFactory<ILanguageService, LanguageServiceMetadata>> | languageServiceFactories | The language service factories. |
System.Collections.Generic.ICollection<IExportFactory<IScriptingBehavior, ScriptingBehaviorMetadata>> | scriptingBehaviorFactories | The scripting behavior factories. |
Properties
| Improve this Doc View SourceContextFactory
Gets the context factory.
Declaration
public IContextFactory ContextFactory { get; }
Property Value
Type | Description |
---|---|
IContextFactory | The context factory. |
Methods
| Improve this Doc View SourceCreateScriptingContext(IScript, IExpando, IContext)
Creates the scripting context.
Declaration
protected virtual IScriptingContext CreateScriptingContext(IScript script, IExpando args, IContext executionContext)
Parameters
Type | Name | Description |
---|---|---|
IScript | script | The script to be interpreted/executed. |
IExpando | args | The arguments. |
IContext | executionContext | The execution context. |
Returns
Type | Description |
---|---|
IScriptingContext | The new scripting context. |
ExecuteAsync(IScript, IExpando, IContext, CancellationToken)
Executes the expression asynchronously.
Declaration
public Task<object> ExecuteAsync(IScript script, IExpando args = null, IContext executionContext = null, CancellationToken cancellationToken = default(CancellationToken))
Parameters
Type | Name | Description |
---|---|---|
IScript | script | The script to be interpreted/executed. |
IExpando | args | Optional. The arguments. |
IContext | executionContext | Optional. The execution context. |
System.Threading.CancellationToken | cancellationToken | Optional. The cancellation token. |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<System.Object> | A promise of the execution result. |
Exceptions
Type | Condition |
---|---|
ScriptingException | Thrown when a Scripting error condition occurs. |