public SendRequestRegisterForm(SendRequestRegister sendRequestRegister) { InitializeComponent(); _origSendRequestRegister = sendRequestRegister; _tempSendRequestRegister = sendRequestRegister.GetCopy() as SendRequestRegister; }
public override Action GetCopy() { var sendRequestRegister = new SendRequestRegister(Id) { CodeOrActionName = this.CodeOrActionName, Direction = this.Direction, Enabled = this.Enabled, Expires = this.Expires, Transport = this.Transport, LocalTerminal = this.LocalTerminal, RemotePort = this.RemotePort, LocalPort = this.LocalPort, IsSendAuthInfo = this.IsSendAuthInfo, LocalIp = this.LocalIp, Login = this.Login, Password = this.Password, RemoteIp = this.RemoteIp, IsAddContent = this.IsAddContent, Id = this.Id, RemoteTerminal = this.RemoteTerminal, Optional = this.Optional, }; return sendRequestRegister; }
public static Action CreateFromActionName(IEnumerable<string> lines) { Action action = null; foreach (var line in lines) { if (line.StartsWith(Strings.ActionName)) { if (line.EndsWith(Strings.Label)) { action = new Label(); } else if (line.EndsWith(Strings.Pause)) { action = new Pause(); } else if (line.EndsWith(Strings.ReceiveRequest)) { action = new ReceiveRequest(); } else if (line.EndsWith(Strings.ReceiveResponse)) { action = new ReceiveResponse(); } else if (line.EndsWith(Strings.SendResponse)) { action = new SendResponse(); } else if (line.EndsWith(Strings.SendRequest)) { action = new SendRequest(); } else if (line.EndsWith(Strings.SendRequestRegister)) { action = new SendRequestRegister(); } break; } } if (action != null) { action.LoadFromStringList(lines); } return action; }
private void RegisterToolStripMenuItemClick(object sender, EventArgs e) { var sendRequestRegister = new SendRequestRegister((ushort) _actions.Count) { Transport = comboBoxTransport.Text, LocalIp = textBoxLocalIP.Text.Trim(), LocalPort = (int) numericUpDownLocalPort.Value, LocalTerminal = textBoxLocalTerminal.Text.Trim(), RemoteIp = textBoxRemoteIp.Text.Trim(), RemotePort = (int) numericUpDownRemotePort.Value, RemoteTerminal = textBoxRemoteTerminal.Text.Trim() }; if (DialogResult.OK == sendRequestRegister.Edit()) { _actions.Add(sendRequestRegister); dataGridViewActions.Invalidate(); dataGridViewActions.Refresh(); } }