private void btnAction_Click(object sender, EventArgs e) { if (videoTestSession == null) { bool isRemote = rbVideoRemote.Checked; rbVideoRemote.Enabled = false; rbVideoLocal.Enabled = false; videoTestSession = isRemote ? HorusSession.CreateRemoteSession(new Uri(tbxEndpointV1.Text), tbxUser.Text, tbxPassword.Text) : HorusSession.CreateLocalSession(); List<HorusDeviceSummary> logicalDevices = videoTestSession.EnumDevices<IVideo>(); cbLogicalVideoDevices.Items.Clear(); foreach(HorusDeviceSummary device in logicalDevices) { cbLogicalVideoDevices.Items.Add(new LogicalDeviceModel(device)); } if (cbLogicalVideoDevices.Items.Count > 0) cbLogicalVideoDevices.SelectedIndex = 0; btnAction.Text = "Connect"; } else { var logicalDevice = cbLogicalVideoDevices.SelectedItem as LogicalDeviceModel; if (logicalDevice != null) { HorusVideo video = videoTestSession.CreateVideoInstance(logicalDevice.DeviceSummary); videoController.PlayVideo(video); } } }
void btnDomeAction_Click(object sender, EventArgs e) { if (localDomeSession == null) { localDomeSession = HorusSession.CreateLocalSession(); List<HorusDeviceSummary> logicalDevices = localDomeSession.EnumDevices<IDome>(); cbLogicalDomeDevices.Items.Clear(); foreach (HorusDeviceSummary device in logicalDevices) { cbLogicalDomeDevices.Items.Add(new LogicalDeviceModel(device)); } if (cbLogicalDomeDevices.Items.Count > 0) { cbLogicalDomeDevices.SelectedIndex = 0; btnDomeConnect.Enabled = true; btnDomeDisconnect.Enabled = false; } } }