本文整理汇总了C#中IScope.SetValue方法的典型用法代码示例。如果您正苦于以下问题:C# IScope.SetValue方法的具体用法?C# IScope.SetValue怎么用?C# IScope.SetValue使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IScope
的用法示例。
在下文中一共展示了IScope.SetValue方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Register
/// <summary>
/// Add built-in debug functions to the scope
/// </summary>
internal static void Register(IScope scope)
{
scope.SetValue("l3.repl", new Repl());
scope.SetValue("l3.debug.break", new Break());
scope.SetValue("l3.debug.getTicks", new GetTicks());
scope.SetValue("l3.throw", new Throw());
}
示例2: Register
/// <summary>
/// Add built-in array functions to the scope
/// </summary>
internal static void Register(IScope scope)
{
scope.SetValue("l3.mapToMap", new MapToMap());
scope.SetValue("l3.mapToArray", new MapToArray());
scope.SetValue("l3.getMapKeys", new GetMapKeys());
scope.SetValue("l3.getMapValues", new GetMapValues());
}
示例3: Register
/// <summary>
/// Add built-in array functions to the scope
/// </summary>
internal static void Register(IScope scope)
{
scope.SetValue("l3.combine", new Combine());
scope.SetValue("l3.addToArray", new AddToArray());
scope.SetValue("l3.arrayToArray", new ArrayToArray());
scope.SetValue("l3.foldLeft", new FoldLeft());
scope.SetValue("l3.foldRight", new FoldRight());
}
示例4: Register
/// <summary>
/// Add built-in Value functions to the scope
/// </summary>
internal static void Register(IScope scope)
{
scope.SetValue("l3.getScope", new GetScope());
scope.SetValue("l3.popScope", new PopScope());
scope.SetValue("l3.callWithScope", new CallWithScope());
scope.SetValue("l3.evalWithScope", new EvalWithScope());
scope.SetValue("l3.onScopeExit", new OnScopeExit());
}
示例5: Register
/// <summary>
/// Add built-in Value functions to the scope
/// </summary>
internal static void Register(IScope scope)
{
scope.SetValue("l3.equal?", new IsEqual());
scope.SetValue("l3.anyEqual?", new IsAnyEqual());
scope.SetValue("l3.and?", new LogicalAnd());
scope.SetValue("l3.or?", new LogicalOr());
scope.SetValue("l3.not?", new LogicalNot());
}
示例6: AddToScope
/// <summary>Add values from one scope onto another</summary>
internal static void AddToScope(IScope from, IScope to)
{
Dictionary<string, Value> dict = from.AsMap.Raw;
if (dict != null)
foreach (string key in dict.Keys)
to.SetValue(key, dict[key]);
}
示例7: Register
/// <summary>
/// Add built-in functions to the scope
/// </summary>
internal static void Register(IScope scope)
{
scope.SetValue("l3.toString", new ConvertToString());
scope.SetValue("l3.intToChar", new IntToChar());
scope.SetValue("l3.stringConcat", new StringConcat());
scope.SetValue("l3.formatTable", new FormatTable());
scope.SetValue("l3.formatTable2", new FormatTable2());
scope.SetValue("l3.stringToArray", new StringToArray());
}
示例8: Register
/// <summary>
/// Add built-in math functions to the scope
/// </summary>
internal static void Register(IScope scope)
{
scope.SetValue("l3.add", new Add());
scope.SetValue("l3.addArray", new AddArray());
scope.SetValue("l3.subtract", new Subtract());
scope.SetValue("l3.multiply", new Multiply());
scope.SetValue("l3.multiplyArray", new MultiplyArray());
scope.SetValue("l3.divide", new Divide());
scope.SetValue("l3.modulo", new Modulo());
scope.SetValue("l3.sqrt", new SquareRoot());
scope.SetValue("l3.power", new Power());
scope.SetValue("l3.lt", new LessThan());
scope.SetValue("l3.gt", new GreaterThan());
scope.SetValue("l3.floor", new Floor());
scope.SetValue("l3.ceiling", new Ceiling());
scope.SetValue("l3.bitAnd", new BitAnd());
scope.SetValue("l3.bitOr", new BitOr());
}
示例9: Register
/// <summary>
/// Add built-in IO functions to the scope
/// </summary>
internal static void Register(IScope scope)
{
scope.SetValue("l3.print", new Print());
}
示例10: Do
/// <summary>
/// Add a new function (prefix, postfix or infix), to the scope
/// </summary>
/// <param name="scope">scope to add function definition to</param>
/// <param name="name">name of the new function</param>
/// <param name="pattern1">null, variable name, or pattern to match for previous token</param>
/// <param name="pattern2">null, variable name, or pattern to match for next token</param>
/// <param name="rawLines">lines to parse and run when function is invoked</param>
/// <param name="precedence">the order in which function should be evaled</param>
internal static void Do(IScope scope, string name,
Value pattern1, Value pattern2, List<Value> rawLines, Order precedence)
{
ValueFunction func = new UserFunction(pattern1, pattern2, rawLines, precedence);
scope.SetValue(name, func);
}
示例11: Register
/// <summary>
/// Add built-in module functions to the scope
/// </summary>
internal static void Register(IScope scope)
{
scope.SetValue("l3.loadModule", new LoadModule());
}
示例12: Eval
internal override Value Eval(Value arg, IScope scope)
{
// extract the delimiter strings
string delims = arg.AsString;
string start = delims.Substring(0, delims.Length / 2);
string end = delims.Substring(delims.Length / 2, delims.Length - delims.Length / 2);
// create the delimiter & store it on the current scope
ValueDelimiter value = new ValueDelimiter(end, DelimiterType);
scope.SetValue(start, value);
return value;
}
示例13: Register
/// <summary>
/// Add built-in Value functions to the scope
/// </summary>
internal static void Register(IScope scope)
{
scope.SetValue("l3.setValue", new SetValue());
scope.SetValue("l3.getValue", new GetValue());
scope.SetValue("l3.copy", new Copy());
scope.SetValue("l3.createMap", new CreateMap());
scope.SetValue("l3.createRange", new CreateRange());
scope.SetValue("l3.createFunction", new CreateFunction());
scope.SetValue("l3.createDelimiter", new CreateDelimiter());
scope.SetValue("l3.createEvalDelimiter", new CreateEvalDelimiter());
scope.SetValue("l3.createArrayDelimiter", new CreateArrayDelimiter());
scope.SetValue("l3.getCount", new GetCount());
scope.SetValue("l3.getMetadata", new GetMetadata());
scope.SetValue("l3.getType", new GetTypeFunction());
scope.SetValue("l3.getFunctionBody", new GetFunctionBody());
scope.SetValue("l3.eval", new EvalValue());
scope.SetValue("l3.bindFunction", new BindFunction());
}
示例14: Register
/// <summary>
/// Add built-in If functions to the scope
/// </summary>
internal static void Register(IScope scope)
{
scope.SetValue("l3.loop", new BasicLoop());
scope.SetValue("l3.forEach", new ForEach());
}
示例15: Register
/// <summary>
/// Add built-in If functions to the scope
/// </summary>
internal static void Register(IScope scope)
{
scope.SetValue("l3.ifBody", new IfBody());
scope.SetValue("l3.ifValue", new IfValue());
}