public widgetsPath[] GetAllWidgetsPath() { List <widgetsPath> widgetsPath = new List <widgetsPath>(); TreeNode[] treeNodes = NewJazzFolderTree.NewJazz_GetAllWidgetsOfTree(); foreach (TreeNode node in treeNodes) { List <string> combatStringArray = new List <string>(); foreach (string path in node.nodePath) { combatStringArray.Add(path); } foreach (string widget in node.widgets) { combatStringArray.Add(widget); widgetsPath oneWidget = new widgetsPath(); oneWidget.widgetPath = combatStringArray.ToArray(); widgetsPath.Add(oneWidget); combatStringArray.Remove(widget); } } return(widgetsPath.ToArray()); }