Esempio n. 1
0
        Node GetLambda(ISignaler signaler, Node input)
        {
            var name      = input.GetEx <string>();
            var whitelist = signaler.Peek <List <Node> >("whitelist");

            if (whitelist != null && !whitelist.Any(x => x.Name == "signal" && x.Get <string>() == name))
            {
                throw new ArgumentException($"Dynamic slot [{name}] does not exist in scope");
            }
            var lambda = Create.GetSlot(name);

            // Preparing arguments, if there are any.
            if (input.Children.Any())
            {
                lambda.Insert(0, new Node(".arguments", null, input.Children.ToList()));
            }

            return(lambda);
        }
Esempio n. 2
0
 /// <summary>
 /// Slot implementation.
 /// </summary>
 /// <param name="signaler">Signaler that raised signal.</param>
 /// <param name="input">Arguments to slot.</param>
 public void Signal(ISignaler signaler, Node input)
 {
     // Retrieving slot's lambda, no reasons to clone, GetSlot will clone.
     input.AddRange(Create.GetSlot(input.GetEx <string>()).Children.ToList());
 }