Exemple #1
0
        public static void GetPlugInNodeList(PlugInNode pin, List <string> plugInsList, StringBuilder plugInsSB, int deep = 0)
        {
            var pinEnum = pin.GetEnumerator();

            if (pinEnum.MoveNext())
            {
                plugInsSB.Append($"{new string('\t', deep)}PlugInNode:'{pin.Name}'{Environment.NewLine}");
                //GetPresets(pin, deep + 1, plugInsList, plugInsSB);

                do
                {
                    GetPlugInNodeList(pinEnum.Current, plugInsList, plugInsSB, deep + 1);
                }while(pinEnum.MoveNext());
            }
            else
            {
                plugInsList.Add($"{pin.Name}");
                plugInsSB.Append($"{new string('\t', deep)}PlugIn:'{pin.Name}'{Environment.NewLine}");
                //GetPresets(pin, deep + 1, plugInsList, plugInsSB);
            }
        }
Exemple #2
0
        public static void GetPlugInNodeTree(PlugInNode pin, EffectTreeModel plugInsTree, StringBuilder plugInsSB = null, int deep = 0)
        {
            if (plugInsSB == null)
            {
                plugInsSB = new StringBuilder();
            }

            IEnumerator <PlugInNode> pinEnum = pin.GetEnumerator();

            if (pin.IsContainer)
            {
                var current = new EffectTreeModel
                {
                    Name        = pin.Name,
                    IsContainer = false
                };
                plugInsSB.Append($"{new string('\t', deep)}{(pin.Any() ? "+" : "-")} PlugInNode:'{pin.Name}'{Environment.NewLine}");
                //GetPresets(pin, deep + 1, plugInsList, plugInsSB);
                while (pinEnum.MoveNext())
                {
                    GetPlugInNodeTree(pinEnum.Current, current, plugInsSB, deep + 1);
                }
                plugInsTree.Items.Add(current);
            }
            else
            {
                var current = new EffectTreeModel
                {
                    Name        = pin.Name,
                    IsContainer = true
                };
                plugInsSB.Append($"{new string('\t', deep)}PlugIn:'{pin.Name}'{Environment.NewLine}");
                GetPresets(pin, deep + 1, current, plugInsSB);
                plugInsTree.Items.Add(current);
            }
        }