Example #1
0
        private void showRightClickMenu_ItemClicked(object sender, ToolStripItemClickedEventArgs e)
        {
            this.showRightClickMenu.Close();
            RightClickCommands n = (RightClickCommands)e.ClickedItem.Tag;

            switch (n)
            {
            case RightClickCommands.kVisitTVDBSeason:
            {
                this.TVDBFor(this.mLastSeasonClicked);
                break;
            }

            case RightClickCommands.kVisitTVDBSeries:
            {
                this.TVDBFor(this.mLastShowClicked);
                break;
            }

            case RightClickCommands.kForceRefreshSeries:
                this.ForceRefresh(this.mLastShowClicked);
                break;

            default:
            {
                if ((n >= RightClickCommands.kWatchBase) && (n < RightClickCommands.kOpenFolderBase))
                {
                    int wn = n - RightClickCommands.kWatchBase;
                    if ((this.mLastFL != null) && (wn >= 0) && (wn < this.mLastFL.Count))
                    {
                        Helpers.SysOpen(this.mLastFL[wn].FullName);
                    }
                }
                else if (n >= RightClickCommands.kOpenFolderBase)
                {
                    int fnum = n - RightClickCommands.kOpenFolderBase;

                    if (fnum < this.mFoldersToOpen.Count)
                    {
                        string folder = this.mFoldersToOpen[fnum];

                        if (Directory.Exists(folder))
                        {
                            Helpers.SysOpen(folder);
                        }
                    }
                    return;
                }
                else
                {
                    System.Diagnostics.Debug.Fail("Unknown right-click action " + n);
                }
                break;
            }
            }
        }
Example #2
0
        private void showRightClickMenu_ItemClicked(object sender, [NotNull] ToolStripItemClickedEventArgs e)
        {
            showRightClickMenu.Close();
            RightClickCommands n = (RightClickCommands)e.ClickedItem.Tag;

            switch (n)
            {
            case RightClickCommands.kVisitTvdbSeason:
            {
                TvdbFor(mLastSeasonClicked);
                break;
            }

            case RightClickCommands.kVisitTvdbSeries:
            {
                TvdbFor(mLastShowClicked);
                break;
            }

            case RightClickCommands.kForceRefreshSeries:
                ForceRefresh(mLastShowClicked);
                break;

            default:
            {
                if (n >= RightClickCommands.kWatchBase && n < RightClickCommands.kOpenFolderBase)
                {
                    int wn = n - RightClickCommands.kWatchBase;
                    if (mLastFileList != null && wn >= 0 && wn < mLastFileList.Count)
                    {
                        Helpers.SysOpen(mLastFileList[wn].FullName);
                    }
                }
                else if (n >= RightClickCommands.kOpenFolderBase)
                {
                    int fnum = n - RightClickCommands.kOpenFolderBase;

                    if (fnum < mFoldersToOpen.Count)
                    {
                        string folder = mFoldersToOpen[fnum];

                        if (Directory.Exists(folder))
                        {
                            Helpers.SysOpen(folder);
                        }
                    }
                }
                else
                {
                    Debug.Fail("Unknown right-click action " + n);
                }

                break;
            }
            }
        }
Example #3
0
 private void GenerateMenu(ContextMenuStrip showRightClickMenu, string menuName, RightClickCommands rightClickCommand)
 {
     GenerateMenu(showRightClickMenu, menuName, (int)rightClickCommand);
 }
Example #4
0
        private void duplicateRightClickMenu_ItemClicked(object sender,
                                                         ToolStripItemClickedEventArgs e)
        {
            duplicateRightClickMenu.Close();

            if (e.ClickedItem.Tag != null)
            {
                RightClickCommands n = (RightClickCommands)e.ClickedItem.Tag;

                ShowItem si = mlastSelected?.ShowItem;

                switch (n)
                {
                case RightClickCommands.kEpisodeGuideForShow:     // epguide
                    if (mlastSelected != null)
                    {
                        mainUi.GotoEpguideFor(mlastSelected.Episode, true);
                    }
                    else
                    {
                        if (si != null)
                        {
                            mainUi.GotoEpguideFor(si, true);
                        }
                    }
                    Close();
                    break;

                case RightClickCommands.kForceRefreshSeries:
                    if (si != null)
                    {
                        mainUi.ForceRefresh(new List <ShowItem> {
                            si
                        });
                    }
                    Close();
                    break;

                case RightClickCommands.kEditShow:
                    if (si != null)
                    {
                        mainUi.EditShow(si);
                    }
                    break;

                case RightClickCommands.kEditSeason:
                    if (si != null)
                    {
                        mainUi.EditSeason(si, mlastSelected.SeasonNumber);
                    }
                    break;

                case RightClickCommands.kAddRule:
                    if (mlastSelected != null)
                    {
                        ShowRule sr = mlastSelected.GenerateRule();

                        si?.AddSeasonRule(mlastSelected.SeasonNumber, sr);

                        lvDuplicates.Items.Remove(mlastClicked);
                        dupEps.Remove(mlastSelected);
                    }
                    break;

                default:
                {
                    System.Diagnostics.Debug.Fail("Unknown right-click action " + n);
                    break;
                }
                }
            }
            mlastSelected = null;
        }
Example #5
0
        public void duplicateRightClickMenu_ItemClicked(object sender,
                                                        ToolStripItemClickedEventArgs e)
        {
            this.duplicateRightClickMenu.Close();

            if (e.ClickedItem.Tag != null)
            {
                RightClickCommands n = (RightClickCommands)e.ClickedItem.Tag;

                ShowItem si = this.mlastSelected?.ShowItem;

                switch (n)
                {
                case RightClickCommands.kEpisodeGuideForShow:     // epguide
                    if (this.mlastSelected != null)
                    {
                        this.mainUI.GotoEpguideFor(this.mlastSelected.Episode, true);
                    }
                    else
                    {
                        if (si != null)
                        {
                            this.mainUI.GotoEpguideFor(si, true);
                        }
                    }
                    Close();
                    break;


                case RightClickCommands.kForceRefreshSeries:
                    if (si != null)
                    {
                        this.mainUI.ForceRefresh(new List <ShowItem> {
                            this.mlastSelected.ShowItem
                        });
                    }
                    Close();
                    break;

                case RightClickCommands.kEditShow:
                    if (si != null)
                    {
                        this.mainUI.EditShow(si);
                    }
                    break;

                case RightClickCommands.kEditSeason:
                    if (si != null)
                    {
                        this.mainUI.EditSeason(si, this.mlastSelected.SeasonNumber);
                    }
                    break;

                case RightClickCommands.kAddRule:
                    ShowRule sr = new ShowRule();
                    sr.DoWhatNow = RuleAction.kMerge;
                    sr.First     = this.mlastSelected.episodeOne.AppropriateEpNum;
                    sr.Second    = this.mlastSelected.episodeTwo.AppropriateEpNum;

                    si?.AddSeasonRule(this.mlastSelected.SeasonNumber, sr);

                    this.lvDuplicates.Items.Remove(this.mlastClicked);
                    this.dupEps.Remove(this.mlastSelected);
                    break;

                default:
                {
/*                        if ((n >= RightClickCommands.kWatchBase) && (n < RightClickCommands.kOpenFolderBase))
 *                      {
 *                          int wn = n - RightClickCommands.kWatchBase;
 *                          if ((this.mLastFL != null) && (wn >= 0) && (wn < this.mLastFL.Count))
 *                              Helpers.SysOpen(this.mLastFL[wn].FullName);
 *                      }
 *                      else if (n >= RightClickCommands.kOpenFolderBase)
 *                      {
 *                          int fnum = n - RightClickCommands.kOpenFolderBase;
 *
 *                          if (fnum < this.mFoldersToOpen.Count)
 *                          {
 *                              string folder = this.mFoldersToOpen[fnum];
 *
 *                              if (Directory.Exists(folder))
 *                                  Helpers.SysOpen(folder);
 *                          }
 *
 *                          return;
 *                      }
 *                      else*/
                    System.Diagnostics.Debug.Fail("Unknown right-click action " + n);

                    break;
                }
                }
            }

            this.mlastSelected = null;
        }
Example #6
0
 private static void GenerateMenu([NotNull] ContextMenuStrip showRightClickMenu, string menuName, RightClickCommands rightClickCommand)
 {
     GenerateMenu(showRightClickMenu, menuName, (int)rightClickCommand);
 }