private void updateDeviceButton_Click(object sender, EventArgs e) { try { string selectedDeviceId = devicesGridView.CurrentRow.Cells[0].Value.ToString(); RegistryManager registryManager = RegistryManager.CreateFromConnectionString(activeIoTHubConnectionString); DeviceUpdateForm updateForm = new DeviceUpdateForm(registryManager, MAX_COUNT_OF_DEVICES, selectedDeviceId); updateForm.ShowDialog(this); updateForm.Dispose(); updateDevicesGridView(); registryManager.CloseAsync(); } catch (Exception ex) { MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
private void updateDeviceButton_Click(object sender, EventArgs e) { try { string selectedDeviceId = devicesGridView.CurrentRow.Cells[0].Value.ToString(); RegistryManager registryManager = RegistryManager.CreateFromConnectionString(activeIoTHubConnectionString); DeviceUpdateForm updateForm = new DeviceUpdateForm(registryManager, MAX_COUNT_OF_DEVICES, selectedDeviceId); updateForm.ShowDialog(this); updateForm.Dispose(); updateDevicesGridView(); registryManager.CloseAsync(); } catch (Exception ex) { MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } }