public static PlugInNode GetPlugIn(string plugInName) { PlugInNode pin = VegasHandler.Vegas.PlugIns.GetChildByName(plugInName); if (pin != null && pin.Any()) { return(pin); } else { throw new ArgumentException($"There is no PlugInNode (Effect) with name '{plugInName}'", nameof(plugInName)); } }
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); } }