public static void SetPlayer(object sender, EventArgs e) { Button this_obj = sender as Button; condition_form cf = new condition_form(); string playerInfo = ""; if (cf.ShowDialog() == DialogResult.OK) { foreach (TreeNode item in cf.conditionInfo.Nodes) { if (item.Tag != null) { playerInfo += item.Tag.ToString(); } } if (playerInfo.Trim() != "") { this_obj.Tag = "\"player\":[" + playerInfo.TrimEnd(',') + "]"; } else { this_obj.Tag = null; } } }
public static void SetItems(object sender, EventArgs e) { Button this_obj = sender as Button; condition_form cf = new condition_form(); string itemInfo = ""; if (cf.ShowDialog() == DialogResult.OK) { foreach (Control tool_page in cf.condition_tab.TabPages[5].Controls) { if (tool_page is TabControl) { TabControl tool_tab = tool_page as TabControl; foreach (TabPage page in tool_tab.TabPages) { if (page.Tag != null) { itemInfo += page.Tag.ToString(); } } break; } } if (itemInfo.Trim() != "") { this_obj.Tag = itemInfo.TrimEnd(','); } else { this_obj.Tag = null; } } }