/// <summary> /// Initializes a new instance of the class. /// </summary> public FrmDeviceData(IAdminContext adminContext, CommApp commApp, DeviceConfig deviceConfig) : this() { this.adminContext = adminContext ?? throw new ArgumentNullException(nameof(adminContext)); this.commApp = commApp ?? throw new ArgumentNullException(nameof(commApp)); this.deviceConfig = deviceConfig ?? throw new ArgumentNullException(nameof(deviceConfig)); dataBox = new RemoteLogBox(lbDeviceData) { FullLogView = true }; frmDeviceCommand = null; isClosed = false; }
private void btnSendCommand_Click(object sender, EventArgs e) { // show device command form if (dataBox.AgentClient is IAgentClient agentClient) { if (frmDeviceCommand == null) { frmDeviceCommand = new FrmDeviceCommand(adminContext, deviceConfig); } frmDeviceCommand.AgentClient = agentClient; frmDeviceCommand.ShowDialog(); } }