private void listBoxCommunicationLinks_SelectedIndexChanged(object sender, EventArgs e) { int idx = listBoxCommunicationLinks.SelectedIndex; driver = Drivers[idx]; commProperties.SelectedObject = driver; }
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), }); }
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); }
private void comboBoxCommunicationPort_SelectedIndexChanged(object sender, EventArgs e) { var idx = comboBoxCommunicationPort.SelectedIndex; Driver = drivers[idx]; }
public GatewayDialog(CommunicationDriver data) { InitializeComponent(); Data = data; this.DataContext = Data; }
public GatewayDialog() { InitializeComponent(); Data = new CommunicationDriver(); this.DataContext = Data; }