示例#1
0
 public override Action GetCopy()
 {
     var sendResponse = new SendResponse(Id, CodeOrActionName)
                            {
                                Direction = this.Direction,
                                Enabled = this.Enabled,
                                IsAddContent = this.IsAddContent,
                                LocalIp = this.LocalIp,
                                LocalPort = this.LocalPort,
                                LocalTerminal = this.LocalTerminal,
                                Optional = this.Optional,
                                RemoteIp = this.RemoteIp,
                                RemotePort = this.RemotePort,
                                RemoteTerminal = this.RemoteTerminal,
                                Transport = this.Transport,
                                CodeOrActionName = this.CodeOrActionName,
                                Id = this.Id,
                            };
     return sendResponse;
 }
 public SendResponseForm(SendResponse originalSendResponse)
 {
     _originalSendResponse = originalSendResponse;
     _tempSendResponse = originalSendResponse.GetCopy() as SendResponse;
     InitializeComponent();
 }
示例#3
0
        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;
        }
示例#4
0
 private void AddSendResponse(string name)
 {
     var sendResponse = new SendResponse((ushort)_actions.Count, name)
     {
         Transport = comboBoxTransport.Text,
         LocalIp = textBoxLocalIP.Text.Trim(),
         LocalPort = (int)numericUpDownLocalPort.Value,
     };
     var dialogResult = sendResponse.Edit();
     if (dialogResult == DialogResult.OK)
     {
         _actions.Add(sendResponse);
         dataGridViewActions.Invalidate();
         dataGridViewActions.Refresh();
     }
 }