private void LaunchCANDeviceInformationForm(Label label, Enum deviceId, DeviceRetrievalHandler onDeviceRetrive, DeviceRestartRequest.RestartHandler onRestartHandler) { Device device = onDeviceRetrive(deviceId); if (null != device) { CANDeviceInformationForm deviceInformationForm = new CANDeviceInformationForm(); this.SetDialogLocation(label, deviceInformationForm); deviceInformationForm.Title = label.Text; deviceInformationForm.Device = device; deviceInformationForm.DeviceId = deviceId; deviceInformationForm.OnDeviceRestart = onRestartHandler; this.DimBackground(); deviceInformationForm.ShowDialog(); this.LightBackground(); } }
public void RestartDevice(Enum deviceId, DeviceRestartRequest.CompleteHandler onComplete) { lock (this) { DeviceRestartRequest request = new DeviceRestartRequest(deviceId, onComplete); this.deviceResetQueue.Enqueue(request); } }