using System; using System.Collections.Generic; using System.ComponentModel; using System.Drawing; using System.Data; using System.Linq; using System.Text; using System.Windows.Forms; using HySoft.IVRFlowEditor.IVRControlUtility; using HySoft.IVRFlowEditor.Utility; using HySoft.IVRFlowEditor.Model; namespace HySoft.IVRFlowEditor.IVRControl { public partial class CtlIVRStringop : UserControl { IVRStringop _IVRStringop; public CtlIVRStringop(IVRStringop obj) { InitializeComponent(); _IVRStringop = obj; this.Load += new EventHandler(CtlIVRStringop_Load); } void CtlIVRStringop_Load(object sender, EventArgs e) { this.tb_NodeID.Text = _IVRStringop.Pos; this.tb_NodeName.Text = _IVRStringop.Name; this.rtb_Note.Text = _IVRStringop.Note; this.cmb_NextNode.DataSource = GlobalController.GetComBoBoxofIVR(); this.cmb_NextNode.DisplayMember = "Note";//2017-5-8将Name改为Note this.cmb_NextNode.ValueMember = "ID"; if (_IVRStringop.Next != null) cmb_NextNode.SelectedItem = _IVRStringop.Next; this.cmb_FalsePos.DataSource = GlobalController.GetComBoBoxofIVR(); this.cmb_FalsePos.DisplayMember = "Note";//2017-5-8将Name改为Note this.cmb_FalsePos.ValueMember = "ID"; if (_IVRStringop.FalsePos != null) cmb_FalsePos.SelectedItem = _IVRStringop.FalsePos; this.cmb_TruePos.DataSource = GlobalController.GetComBoBoxofIVR(); this.cmb_TruePos.DisplayMember = "Note";//2017-5-8将Name改为Note this.cmb_TruePos.ValueMember = "ID"; if (_IVRStringop.TruePos != null) cmb_TruePos.SelectedItem = _IVRStringop.TruePos; GlobalController.BindComBoBoxOfEnumDesc(this.cmb_OpType, _IVRStringop.OpType); this.cmb_AppendVar.DataSource = GlobalController.GetFlowVar().ToList(); this.cmb_AppendVar.DisplayMember = "VarName"; this.cmb_AppendVar.ValueMember = "VarName"; if (_IVRStringop.AppendVar != null) this.cmb_AppendVar.Text = _IVRStringop.AppendVar; this.cmb_MatchVar.DataSource = GlobalController.GetFlowVar().ToList(); this.cmb_MatchVar.DisplayMember = "VarName"; this.cmb_MatchVar.ValueMember = "VarName"; if (_IVRStringop.MatchVar != null) this.cmb_MatchVar.Text = _IVRStringop.MatchVar; this.cmb_OperateVar.DataSource = GlobalController.GetFlowVar().ToList(); this.cmb_OperateVar.DisplayMember = "VarName"; this.cmb_OperateVar.ValueMember = "VarName"; if (_IVRStringop.OperateVar != null) this.cmb_OperateVar.Text = _IVRStringop.OperateVar; this.cmb_RepAsVar.DataSource = GlobalController.GetFlowVar().ToList(); this.cmb_RepAsVar.DisplayMember = "VarName"; this.cmb_RepAsVar.ValueMember = "VarName"; if (_IVRStringop.RepAsVar != null) this.cmb_RepAsVar.Text = _IVRStringop.RepAsVar; this.cmb_ReplaceVar.DataSource = GlobalController.GetFlowVar().ToList(); this.cmb_ReplaceVar.DisplayMember = "VarName"; this.cmb_ReplaceVar.ValueMember = "VarName"; if (_IVRStringop.ReplaceVar != null) this.cmb_ReplaceVar.Text = _IVRStringop.ReplaceVar; this.cmb_ResultVar.DataSource = GlobalController.GetFlowVar().ToList(); this.cmb_ResultVar.DisplayMember = "VarName"; this.cmb_ResultVar.ValueMember = "VarName"; if (_IVRStringop.ResultVar != null) this.cmb_ResultVar.Text = _IVRStringop.ResultVar; this.num_InterceptIdx.Value = _IVRStringop.InterceptIdx; this.num_InterceptLen.Value = _IVRStringop.InterceptLen; } private void btn_enter_Click(object sender, EventArgs e) { _IVRStringop.Next = this.cmb_NextNode.SelectedItem as IVRControlBase; _IVRStringop.TruePos = this.cmb_TruePos.SelectedItem as IVRControlBase; _IVRStringop.FalsePos = this.cmb_FalsePos.SelectedItem as IVRControlBase; _IVRStringop.OpType = GlobalController.GetEnumByComBoBoxValueOFDesc(this.cmb_OpType.Text); _IVRStringop.AppendVar=this.cmb_AppendVar.Text ; _IVRStringop.MatchVar = this.cmb_MatchVar.Text; _IVRStringop.OperateVar = this.cmb_OperateVar.Text; _IVRStringop.RepAsVar = this.cmb_RepAsVar.Text; _IVRStringop.ReplaceVar = this.cmb_ReplaceVar.Text; _IVRStringop.ResultVar = this.cmb_ResultVar.Text; _IVRStringop.InterceptIdx=(int)this.num_InterceptIdx.Value ; _IVRStringop.InterceptLen=(int)this.num_InterceptLen.Value; _IVRStringop.Pos = this.tb_NodeID.Text; _IVRStringop.Name = this.tb_NodeName.Text; _IVRStringop.Note = this.rtb_Note.Text; this.FindForm().DialogResult = DialogResult.OK; this.FindForm().Close(); } private void btn_cancel_Click(object sender, EventArgs e) { this.FindForm().DialogResult = DialogResult.No; this.FindForm().Close(); } } }