public widgetsPath[] GetWidgetsPathOfFolder(string[] folderPath) { List <widgetsPath> widgetsPath = new List <widgetsPath>(); string[] widgets = NewJazzFolderTree.NewJazz_GetChildrenOfFolder(folderPath); List <string> combatStringArray = new List <string>(); foreach (string path in folderPath) { combatStringArray.Add(path); } foreach (string widget in widgets) { combatStringArray.Add(widget); widgetsPath oneWidget = new widgetsPath(); oneWidget.widgetPath = combatStringArray.ToArray(); widgetsPath.Add(oneWidget); combatStringArray.Remove(widget); } return(widgetsPath.ToArray()); }