コード例 #1
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)
        {
            var tmp    = new Node();
            var format = false;

            if (input.Value != null)
            {
                format = input.Children.FirstOrDefault(x => x.Name == "format")?.GetEx <bool>() ?? false;
                tmp.AddRange(input.Evaluate().Select(x => x.Clone()));
            }
            else
            {
                tmp.AddRange(input.Children.Select(x => x.Clone()));
            }

            var jContainer = Lambda2JsonTransformer.ToJson(tmp);

            input.Clear();
            input.Value = jContainer.ToString(format ? Newtonsoft.Json.Formatting.Indented : Newtonsoft.Json.Formatting.None);
        }
コード例 #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)
 {
     input.Value = Lambda2JsonTransformer.ToJson(input);
     input.Clear();
 }