/// <summary> /// Display the reply fields based on the type of data /// </summary> /// <param name="sender"></param> private void setFields(object sender) { for (int childIndex = 0; childIndex < m_replies.Count; ++childIndex) { if (sender == null || // Display every reply type sender == m_replies[childIndex].typeField) // Display this precise reply type { m_replyTrade[childIndex].Visible = false; m_replyBranch[childIndex].Visible = false; m_replyFlag[childIndex].Visible = false; TalkNodeTypes newType = (TalkNodeTypes)Enum.Parse(typeof(TalkNodeTypes), (String)m_replies[childIndex].typeField.SelectedItem); switch (newType) { case TalkNodeTypes.None: { } break; case TalkNodeTypes.Trade: { Reply.Trade gui = m_replyTrade[childIndex]; gui.Focus(); gui.Visible = true; gui.setTreeNode(m_replies[childIndex].treeNode); } break; case TalkNodeTypes.Branch: { Reply.Branch gui = m_replyBranch[childIndex]; gui.Focus(); gui.Visible = true; gui.setTreeNode(m_replies[childIndex].treeNode); } break; case TalkNodeTypes.Flags: { Reply.Flag gui = m_replyFlag[childIndex]; gui.Focus(); gui.Visible = true; gui.setTreeNode(m_replies[childIndex].treeNode); gui.UpdateData(); } break; } } } }
private void manageReply(ComboBox cbo) { m_replies.Add(new Replies(null, cbo)); cbo.SelectedValueChanged += new EventHandler(onReplyTypeSelected); cbo.Items.Clear(); cbo.Items.AddRange(m_replieTypes); cbo.SelectedItem = cbo.Items[0]; Reply.Branch branch = new Reply.Branch(this); positionReply(cbo, branch); m_replyBranch.Add(branch); Reply.Trade trade = new Reply.Trade(); positionReply(cbo, trade); m_replyTrade.Add(trade); Reply.Flag flag = new Reply.Flag(this); positionReply(cbo, flag); m_replyFlag.Add(flag); }