public void TransferToChain(int index, ExecuteableCodeblockChain target, int targetIndex)
        {
            IExecuteableCodeblock item = this[index];

            target.Insert(targetIndex, item);
            this.RemoveAt(index);
        }
        public void TransferToChain(int index, int count, ExecuteableCodeblockChain target, int targetIndex)
        {
            IEnumerable <IExecuteableCodeblock> items = GetRange(index, count);

            target.InsertRange(targetIndex, items);
            this.RemoveRange(index, count);
        }
예제 #3
0
        public CodeblockTree()
        {
            Logger = new ConsoleLogger();

            MainChain   = new ExecuteableCodeblockChain();
            LooseChains = new List <ExecuteableCodeblockChain>();
        }
예제 #4
0
        private JObject SerializeCodeblockChainToJObject(ExecuteableCodeblockChain chain)
        {
            JArray items = new JArray(chain.Select(b => SerializeCodeblockToJObject(b as Codeblock)).ToArray());

            JObject obj = new JObject
            {
                { "items", items }
            };

            return(obj);
        }
예제 #5
0
 public string SerializeCodeblockChain(ExecuteableCodeblockChain chain)
 => SerializeCodeblockChainToJObject(chain).ToString(SerializerSettings.ToJsonSettings().Formatting);