Skip to main content

ScriptScopeContextUtils

Assembly: ServiceStack.Common.dll
View Source
Declaration
public static class ScriptScopeContextUtils

Methods

ReturnValue(ScriptScopeContext, Object, Dictionary<String, Object>)

View Source
Declaration
public static StopExecution ReturnValue(this ScriptScopeContext scope, object returnValue, Dictionary<string, object> returnArgs = null)
Returns

ServiceStack.Script.StopExecution

Parameters
TypeName
ServiceStack.Script.ScriptScopeContextscope
System.ObjectreturnValue
System.Collections.Generic.Dictionary<System.String,System.Object>returnArgs

GetValue(ScriptScopeContext, String)

Resolve value from stored arguments and filters

View Source
Declaration
public static object GetValue(this ScriptScopeContext scope, string name)
Returns

System.Object

Parameters
TypeName
ServiceStack.Script.ScriptScopeContextscope
System.Stringname

GetArgument(ScriptScopeContext, String)

Resolve value from stored arguments only

View Source
Declaration
public static object GetArgument(this ScriptScopeContext scope, string name)
Returns

System.Object

Parameters
TypeName
ServiceStack.Script.ScriptScopeContextscope
System.Stringname

TryGetValue(ScriptScopeContext, String, out Object)

Try Resolve value from stored arguments and filters

View Source
Declaration
public static bool TryGetValue(this ScriptScopeContext scope, string name, out object value)
Returns

System.Boolean

Parameters
TypeName
ServiceStack.Script.ScriptScopeContextscope
System.Stringname
System.Objectvalue

TryGetMethod(ScriptScopeContext, String, Int32, out Delegate, out ScriptMethods, out Boolean)

View Source
Declaration
public static bool TryGetMethod(this ScriptScopeContext scope, string name, int fnArgValuesCount, out Delegate fn, out ScriptMethods scriptMethod, out bool requiresScope)
Returns

System.Boolean

Parameters
TypeName
ServiceStack.Script.ScriptScopeContextscope
System.Stringname
System.Int32fnArgValuesCount
System.Delegatefn
ServiceStack.Script.ScriptMethodsscriptMethod
System.BooleanrequiresScope

EvaluateExpression(ScriptScopeContext, String)

View Source
Declaration
public static object EvaluateExpression(this ScriptScopeContext scope, string expr)
Returns

System.Object

Parameters
TypeName
ServiceStack.Script.ScriptScopeContextscope
System.Stringexpr

CreateScopedContext(ScriptScopeContext, String, Dictionary<String, Object>, Boolean)

View Source
Declaration
public static ScriptScopeContext CreateScopedContext(this ScriptScopeContext scope, string template, Dictionary<string, object> scopeParams = null, bool cachePage = true)
Returns

ServiceStack.Script.ScriptScopeContext

Parameters
TypeName
ServiceStack.Script.ScriptScopeContextscope
System.Stringtemplate
System.Collections.Generic.Dictionary<System.String,System.Object>scopeParams
System.BooleancachePage

WritePageAsync(ScriptScopeContext)

View Source
Declaration
public static Task WritePageAsync(this ScriptScopeContext scope)
Returns

System.Threading.Tasks.Task

Parameters
TypeName
ServiceStack.Script.ScriptScopeContextscope

ScopeWithParams(ScriptScopeContext, Dictionary<String, Object>)

View Source
Declaration
public static ScriptScopeContext ScopeWithParams(this ScriptScopeContext parentContext, Dictionary<string, object> scopedParams)
Returns

ServiceStack.Script.ScriptScopeContext

Parameters
TypeName
ServiceStack.Script.ScriptScopeContextparentContext
System.Collections.Generic.Dictionary<System.String,System.Object>scopedParams

ScopeWith(ScriptScopeContext, Dictionary<String, Object>, Stream)

View Source
Declaration
public static ScriptScopeContext ScopeWith(this ScriptScopeContext parentContext, Dictionary<string, object> scopedParams = null, Stream outputStream = null)
Returns

ServiceStack.Script.ScriptScopeContext

Parameters
TypeName
ServiceStack.Script.ScriptScopeContextparentContext
System.Collections.Generic.Dictionary<System.String,System.Object>scopedParams
System.IO.StreamoutputStream

ScopeWithStream(ScriptScopeContext, Stream)

View Source
Declaration
public static ScriptScopeContext ScopeWithStream(this ScriptScopeContext scope, Stream stream)
Returns

ServiceStack.Script.ScriptScopeContext

Parameters
TypeName
ServiceStack.Script.ScriptScopeContextscope
System.IO.Streamstream

WritePageAsync(ScriptScopeContext, SharpPage, SharpCodePage, Dictionary<String, Object>, CancellationToken)

View Source
Declaration
public static async Task WritePageAsync(this ScriptScopeContext scope, SharpPage page, SharpCodePage codePage, Dictionary<string, object> pageParams, CancellationToken token = default(CancellationToken))
Returns

System.Threading.Tasks.Task

Parameters
TypeName
ServiceStack.Script.ScriptScopeContextscope
ServiceStack.Script.SharpPagepage
ServiceStack.Script.SharpCodePagecodePage
System.Collections.Generic.Dictionary<System.String,System.Object>pageParams
System.Threading.CancellationTokentoken

InvokeAssignExpression(ScriptScopeContext, String, Object, Object)

View Source
Declaration
public static void InvokeAssignExpression(this ScriptScopeContext scope, string assignExpr, object target, object value)
Parameters
TypeName
ServiceStack.Script.ScriptScopeContextscope
System.StringassignExpr
System.Objecttarget
System.Objectvalue