Exemple #1
0
        /// <summary>
        /// called when tvcards were changed (add, remove, enable, disable)
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        public void OnTvCardsChanged(object sender, EventArgs e)
        {
            bool isAnyUserTS;
            bool isRec;
            bool isUserTS;
            bool isRecOrTS = RemoteControl.Instance.IsAnyCardRecordingOrTimeshifting(new User(), out isUserTS, out isAnyUserTS,
                                                                                     out isRec);

            if (!isAnyUserTS && !isRec && !isRecOrTS && !isUserTS)
            {
                NotifyForm dlgNotify = new NotifyForm("Restart TvService...", "This can take some time\n\nPlease be patient...");
                try
                {
                    dlgNotify.Show();
                    dlgNotify.WaitForDisplay();

                    RemoteControl.Instance.Restart();

                    // remove all tv servers / cards, add current ones back later
                    RemoveAllChildSections((SectionTreeNode)settingSections[servers.Text]);

                    // re-add tvservers and cards to tree
                    IList <Server> dbsServers = Server.ListAll();
                    AddServerTvCards(servers, dbsServers, true);
                }
                finally
                {
                    dlgNotify.Close();
                }
            }
            else
            {
                MessageBox.Show(this,
                                "In order to apply new settings - please restart tvservice manually when done timeshifting / recording.");
            }
        }
    /// <summary>
    /// called when tvcards were changed (add, remove, enable, disable)
    /// </summary>
    /// <param name="sender"></param>
    /// <param name="e"></param>
    public void OnTvCardsChanged(object sender, EventArgs e)
    {
      bool isAnyUserTS;
      bool isRec;
      bool isUserTS;
      bool isRecOrTS = RemoteControl.Instance.IsAnyCardRecordingOrTimeshifting(new User(), out isUserTS, out isAnyUserTS,
                                                                               out isRec);

      if (!isAnyUserTS && !isRec && !isRecOrTS && !isUserTS)
      {
        NotifyForm dlgNotify = new NotifyForm("Restart TvService...", "This can take some time\n\nPlease be patient...");
        try
        {
          dlgNotify.Show();
          dlgNotify.WaitForDisplay();

          RemoteControl.Instance.Restart();

          // remove all tv servers / cards, add current ones back later
          RemoveAllChildSections((SectionTreeNode)settingSections[servers.Text]);

          // re-add tvservers and cards to tree
          IList<Server> dbsServers = Server.ListAll();
          AddServerTvCards(servers, dbsServers, true);
        }
        finally
        {
          dlgNotify.Close();
        }
      }
      else
      {
        MessageBox.Show(this,
                        "In order to apply new settings - please restart tvservice manually when done timeshifting / recording.");
      }
    }