private void listBoxCommunicationLinks_SelectedIndexChanged(object sender, EventArgs e)
        {
            int idx = listBoxCommunicationLinks.SelectedIndex;

            driver = Drivers[idx];
            commProperties.SelectedObject = driver;
        }
Esempio n. 2
0
        public GatewayNode(CommunicationDriver data)
        {
            Gateway   = data;
            this.Icon = "/Images/solution/gateway.png";

            UpdateText();

            this.ContextMenuItems.Add(new ContextMenuItem()
            {
                Text         = "属性",
                ClickHandler = (s, e) => OnDoublicClick(s, null),
            });
        }
Esempio n. 3
0
        public int UpdateGateway(CommunicationDriver driver)
        {
            if (driver.id == null && this.db.CommunicationDriver.Any(m => m.Address == driver.Address && m.Port == driver.Port))
            {
                throw new Exception("此网关已存在");
            }
            else if (this.db.CommunicationDriver.Any(m => m.id != driver.id && m.Address == driver.Address && m.Port == driver.Port))
            {
                throw new Exception("此网关已存在");
            }

            SystemHelper.AddSysLog(this.User.id.Value, "更新网关信息:" + Newtonsoft.Json.JsonConvert.SerializeObject(driver.ChangedProperties));

            this.db.Update(driver);

            return(driver.id.Value);
        }
Esempio n. 4
0
        private void comboBoxCommunicationPort_SelectedIndexChanged(object sender, EventArgs e)
        {
            var idx = comboBoxCommunicationPort.SelectedIndex;

            Driver = drivers[idx];
        }
Esempio n. 5
0
 public GatewayDialog(CommunicationDriver data)
 {
     InitializeComponent();
     Data             = data;
     this.DataContext = Data;
 }
Esempio n. 6
0
 public GatewayDialog()
 {
     InitializeComponent();
     Data             = new CommunicationDriver();
     this.DataContext = Data;
 }