Esempio n. 1
0
        /// <summary>
        /// Handles button get device information click event
        /// </summary>
        /// <param name="sender">Event sender</param>
        /// <param name="e">Event argument</param>
        private void btnGetDeviceInformation_Click(object sender, EventArgs e)
        {
            DiscoveredDevices devices = ContextController.GetDiscoveredDevices();
            string            url     = devices.ServiceAddress;

            if (!string.IsNullOrEmpty(url))
            {
                try
                {
                    Controller.GetDeviceInformation();
                }
                catch (System.ServiceModel.EndpointNotFoundException)
                {
                    MessageBox.Show(this, "Could not connect to " + url, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
                catch (Exception ex)
                {
                    ShowError(ex);
                }
            }
        }