Exemplo n.º 1
0
 private void CB_TunerDevice_SelectedIndexChanged(object sender, EventArgs e)
 {
     if (TunerName.Equals(VideoInputDeviceList.NetworkDeviceName))
     {
         CHK_ShowNetwork.Checked = true;
     }
 }
Exemplo n.º 2
0
        private void CHK_ShowNetwork_CheckedChanged(object sender, EventArgs e)
        {
            if (TunerName.Equals(VideoInputDeviceList.NetworkDeviceName))
            {
                CHK_ShowNetwork.Checked = true;
            }

            TB_ServerIP.Enabled      = CHK_ShowNetwork.Checked;
            B_RefreshSources.Enabled = CHK_ShowNetwork.Checked;
            cbNetworkSources.Enabled = CHK_ShowNetwork.Checked;
        }
Exemplo n.º 3
0
        /// <summary>
        /// Returns true if the server configuration is valid, or the user wants to keep it
        /// </summary>
        /// <returns>true if valid and should be saved, false if dialog should stay open</returns>
        private bool ValidateServerConfiguration()
        {
            if (!TunerName.Equals(VideoInputDeviceList.NetworkDeviceName))
            {
                return(true);
            }

            ServerConfig server = null;

            try
            {
                server = new ServerConfig(ServerAddress);

                ServerInfo info = server.GetServerInfo();

                bool foundSource = false;

                foreach (StreamSourceInfo i in info.StreamSources.Items)
                {
                    foundSource = (i.SourceName == ServerSource);
                    if (foundSource)
                    {
                        break;
                    }
                }

                if (!foundSource)
                {
                    throw new Exception("The server specified does not have any source called \"" + ServerSource + "\"!");
                }

                return(true);
            }
            catch (Exception ex)
            {
                DialogResult r = FCYesNoMsgBox.ShowDialog("Problem with Network TV configuration",
                                                          "Your Network TV configuration could not be verified. Would you like ignore this problem and keep these network settings anyway?" +
                                                          Environment.NewLine +
                                                          Environment.NewLine +
                                                          ex.Message,
                                                          this);

                return(r == DialogResult.Yes);
            }
            finally
            {
                if (server != null)
                {
                    server.Dispose();
                    server = null;
                }
            }
        }