Пример #1
0
            public override void OnMouseDown(CellContext sender, [NotNull] MouseEventArgs e)
            {
                if (e.Button != MouseButtons.Right)
                {
                    return;
                }

                gridSummary.showRightClickMenu.Items.Clear();

                if (processedSeason != null)
                {
                    if (processedSeason.Show.IgnoreSeasons.Contains(processedSeason.SeasonNumber))
                    {
                        AddRcMenuItem(gridSummary.showRightClickMenu, "Stop Ignoring Season", (o, args) =>
                        {
                            processedSeason.Show.IgnoreSeasons.Remove(processedSeason.SeasonNumber);
                            gridSummary.PopulateGrid();
                        });
                    }
                    else
                    {
                        AddRcMenuItem(gridSummary.showRightClickMenu, "Ignore Season", (o, args) =>
                        {
                            processedSeason.Show.IgnoreSeasons.Add(processedSeason.SeasonNumber);
                            gridSummary.PopulateGrid();
                        });
                    }
                }

                if (show != null)
                {
                    if (show.DoMissingCheck)
                    {
                        AddRcMenuItem(gridSummary.showRightClickMenu, "Stop Checking Show", (o, args) =>
                        {
                            show.DoMissingCheck = false;
                            gridSummary.PopulateGrid();
                        });
                    }
                    else
                    {
                        AddRcMenuItem(gridSummary.showRightClickMenu, "Start Checking Show", (o, args) =>
                        {
                            show.DoMissingCheck = true;
                            gridSummary.PopulateGrid();
                        });
                    }
                }

                GenerateSeparator(gridSummary.showRightClickMenu);

                if (processedSeason is null)
                {
                    AddRcMenuItem(gridSummary.showRightClickMenu, "Force Refresh", (o, args) =>
                    {
                        gridSummary.MainWindow.ForceRefresh(show, false);
                    });

                    GenerateSeparator(gridSummary.showRightClickMenu);
                }

                AddRcMenuItem(gridSummary.showRightClickMenu, "Visit thetvdb.com",
                              (o, args) =>
                {
                    if (processedSeason is null)
                    {
                        TvdbFor(show);
                    }
                    else
                    {
                        TvdbFor(processedSeason);
                    }
                }
                              );

                List <string> added = new List <string>();

                if (processedSeason != null)
                {
                    GenerateOpenMenu(processedSeason, added);
                }

                GenerateRightClickOpenMenu(added);

                if (processedSeason != null)
                {
                    GenerateRightClickWatchMenu(processedSeason);
                }

                Point pt = new Point(e.X, e.Y);

                gridSummary.showRightClickMenu.Show(sender.Grid.PointToScreen(pt));
            }