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
Type | Name |
---|---|
ServiceStack.Script.ScriptScopeContext | scope |
System.Object | returnValue |
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
Type | Name |
---|---|
ServiceStack.Script.ScriptScopeContext | scope |
System.String | name |
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
Type | Name |
---|---|
ServiceStack.Script.ScriptScopeContext | scope |
System.String | name |
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
Type | Name |
---|---|
ServiceStack.Script.ScriptScopeContext | scope |
System.String | name |
System.Object | value |
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
Type | Name |
---|---|
ServiceStack.Script.ScriptScopeContext | scope |
System.String | name |
System.Int32 | fnArgValuesCount |
System.Delegate | fn |
ServiceStack.Script.ScriptMethods | scriptMethod |
System.Boolean | requiresScope |
EvaluateExpression(ScriptScopeContext, String)
View Source
Declaration
public static object EvaluateExpression(this ScriptScopeContext scope, string expr)
Returns
System.Object
Parameters
Type | Name |
---|---|
ServiceStack.Script.ScriptScopeContext | scope |
System.String | expr |
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
Type | Name |
---|---|
ServiceStack.Script.ScriptScopeContext | scope |
System.String | template |
System.Collections.Generic.Dictionary<System.String,System.Object> | scopeParams |
System.Boolean | cachePage |
WritePageAsync(ScriptScopeContext)
View Source
Declaration
public static Task WritePageAsync(this ScriptScopeContext scope)
Returns
System.Threading.Tasks.Task
Parameters
Type | Name |
---|---|
ServiceStack.Script.ScriptScopeContext | scope |
ScopeWithParams(ScriptScopeContext, Dictionary<String, Object>)
View Source
Declaration
public static ScriptScopeContext ScopeWithParams(this ScriptScopeContext parentContext, Dictionary<string, object> scopedParams)
Returns
ServiceStack.Script.ScriptScopeContext
Parameters
Type | Name |
---|---|
ServiceStack.Script.ScriptScopeContext | parentContext |
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
Type | Name |
---|---|
ServiceStack.Script.ScriptScopeContext | parentContext |
System.Collections.Generic.Dictionary<System.String,System.Object> | scopedParams |
System.IO.Stream | outputStream |
ScopeWithStream(ScriptScopeContext, Stream)
View Source
Declaration
public static ScriptScopeContext ScopeWithStream(this ScriptScopeContext scope, Stream stream)
Returns
ServiceStack.Script.ScriptScopeContext
Parameters
Type | Name |
---|---|
ServiceStack.Script.ScriptScopeContext | scope |
System.IO.Stream | stream |
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
Type | Name |
---|---|
ServiceStack.Script.ScriptScopeContext | scope |
ServiceStack.Script.SharpPage | page |
ServiceStack.Script.SharpCodePage | codePage |
System.Collections.Generic.Dictionary<System.String,System.Object> | pageParams |
System.Threading.CancellationToken | token |
InvokeAssignExpression(ScriptScopeContext, String, Object, Object)
View Source
Declaration
public static void InvokeAssignExpression(this ScriptScopeContext scope, string assignExpr, object target, object value)
Parameters
Type | Name |
---|---|
ServiceStack.Script.ScriptScopeContext | scope |
System.String | assignExpr |
System.Object | target |
System.Object | value |