| | |
| | | } |
| | | } |
| | | |
| | | bind.OpConfig.DeviceId = bind.Device; |
| | | |
| | | backOpConfig.DataFrom(bind.OpConfig); |
| | | |
| | | propGrid.SelectedObject = bind.OpConfig; |
| | | |
| | | } |
| | | |
| | | private void CboDevice_SelectedIndexChanged(object sender, EventArgs e) |
| | |
| | | var attr = device.GetType().GetCustomAttribute<DeviceAttribute>(); |
| | | if (attr != null) |
| | | { |
| | | propGrid.SelectedObject = ConfigFactory.GetOperationConfig(attr.TypeCode); |
| | | var opConfig = ConfigFactory.GetOperationConfig(attr.TypeCode); |
| | | opConfig.DeviceId = device.Id; |
| | | propGrid.SelectedObject = opConfig; |
| | | } |
| | | } |
| | | } |
| | |
| | | { |
| | | Bind.Device = cboDevice.SelectedValue.ToString(); |
| | | Bind.OpConfig = propGrid.SelectedObject as IOperationConfig; |
| | | Bind.OpConfig.DeviceId = Bind.Device; |
| | | this.DialogResult = DialogResult.OK; |
| | | } |
| | | |