private void runButton_Click(object sender, EventArgs e) { BaseDevice device = checkInfoAndCreate(); if (device != null) { device.VirtualDeviceManager = virtualDeviceManager; virtualDeviceManager.addDevice(device); device.init(); if (IsSocket) { ((BaseVirtualDevice)device).send_basic_info(); } else { ((BaseTwincatDevice)device).send_basic_info(); } this.Close(); FatherForm.refresh_Devices(); } }