private void SetTreeViewData(TreeNode startNode, NanoD2dCollection controls) { foreach (var control in controls) { TreeNode tmpNode = new TreeNode(control.Name) { Tag = control }; if (startNode == null) { treeView1.Nodes.Add(tmpNode); } else { startNode.Nodes.Add(tmpNode); } if (control is NanoD2dCollection subControls) { SetTreeViewData(tmpNode, subControls); } } }
public static void SaveWallPaperSetting(NanoD2dCollection mainForm) { File.WriteAllText(SettingData.FormFilePos, mainForm.OnSave().ToString()); }