当前位置: 首页>>代码示例>>C#>>正文


C# MainMenu.Add方法代码示例

本文整理汇总了C#中MainMenu.Add方法的典型用法代码示例。如果您正苦于以下问题:C# MainMenu.Add方法的具体用法?C# MainMenu.Add怎么用?C# MainMenu.Add使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在MainMenu的用法示例。


在下文中一共展示了MainMenu.Add方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: OnClicked

        protected override void OnClicked(int controlId, GUIControl control, MediaPortal.GUI.Library.Action.ActionType actionType)
        {
            MainMenu menu = new MainMenu();
            menu.Add(btnWideBanners, () =>
            {
                GUIWindowManager.CloseCurrentWindow();
                GUIWindowManager.ActivateWindow(Constants.WindowIDs.WIDEBANNERS, false);
            });
            menu.Add(btnPosters, () =>
            {
                GUIWindowManager.CloseCurrentWindow();
                GUIWindowManager.ActivateWindow(Constants.WindowIDs.POSTERS, false);
            });
            menu.Add(buttonLayouts, () =>
            {
                bool shouldContinue;
                do
                {
                    shouldContinue = false;
                    switch (CurrentView)
                    {
                        case GUIFacadeControl.Layout.List:
                            CurrentView = GUIFacadeControl.Layout.Playlist;
                            if (!AllowView(CurrentView) || m_Facade.PlayListLayout == null)
                            {
                                shouldContinue = true;
                            }
                            else
                            {
                                m_Facade.CurrentLayout = GUIFacadeControl.Layout.Playlist;
                                BaseConfig.Settings.LastFanartViewMode = GUIFacadeControl.Layout.Playlist;
                                BaseConfig.Settings.Save();
                            }
                            break;

                        case GUIFacadeControl.Layout.Playlist:
                            CurrentView = GUIFacadeControl.Layout.SmallIcons;
                            if (!AllowView(CurrentView) || m_Facade.ThumbnailLayout == null)
                            {
                                shouldContinue = true;
                            }
                            else
                            {
                                m_Facade.CurrentLayout = GUIFacadeControl.Layout.SmallIcons;
                                BaseConfig.Settings.LastFanartViewMode = GUIFacadeControl.Layout.SmallIcons;
                                BaseConfig.Settings.Save();
                            }
                            break;

                        case GUIFacadeControl.Layout.SmallIcons:
                            CurrentView = GUIFacadeControl.Layout.LargeIcons;
                            if (!AllowView(CurrentView) || m_Facade.ThumbnailLayout == null)
                            {
                                shouldContinue = true;
                            }
                            else
                            {
                                m_Facade.CurrentLayout = GUIFacadeControl.Layout.LargeIcons;
                                BaseConfig.Settings.LastFanartViewMode = GUIFacadeControl.Layout.LargeIcons;
                                BaseConfig.Settings.Save();
                            }
                            break;

                        case GUIFacadeControl.Layout.LargeIcons:
                            CurrentView = GUIFacadeControl.Layout.Filmstrip;
                            if (!AllowView(CurrentView) || m_Facade.FilmstripLayout == null)
                            {
                                shouldContinue = true;
                            }
                            else
                            {
                                m_Facade.CurrentLayout = GUIFacadeControl.Layout.Filmstrip;
                                BaseConfig.Settings.LastFanartViewMode = GUIFacadeControl.Layout.Filmstrip;
                                BaseConfig.Settings.Save();
                            }
                            break;

                        case GUIFacadeControl.Layout.Filmstrip:
                            CurrentView = GUIFacadeControl.Layout.List;
                            if (!AllowView(CurrentView) || m_Facade.ListLayout == null)
                            {
                                shouldContinue = true;
                            }
                            else
                            {
                                m_Facade.CurrentLayout = GUIFacadeControl.Layout.List;
                                BaseConfig.Settings.LastFanartViewMode = GUIFacadeControl.Layout.List;
                                BaseConfig.Settings.Save();
                            }
                            break;
                    }
                } while (shouldContinue);
                UpdateLayoutButton();
                GUIControl.FocusControl(GetID, controlId);
            });
            if (menu.Check(control))
                return;
            base.OnClicked(controlId, control, actionType);
        }
开发者ID:japanesemediamanager,项目名称:animeplugin3,代码行数:99,代码来源:FanartWindow.cs

示例2: OnClicked

        protected override void OnClicked(int controlId, GUIControl control, Action.ActionType actionType)
        {
            MainMenu menu = new MainMenu();
            menu.Add(btnServerStatus, ShowPageServerStatus);
            menu.Add(btnListUnlinkedFiles, () =>
            {
                SetGUIProperty(GuiProperty.Utilities_CurrentView, Translation.UnlinkedFiles);
                if (dummyServerStatus != null) dummyServerStatus.Visible = false;
                if (dummyListUnlinkedFiles != null) dummyListUnlinkedFiles.Visible = true;
                m_Facade.Focus = true;
                RefreshUnlinkedFiles();
            });
            menu.Add(btnRunImport, () =>
            {
                JMMServerVM.Instance.clientBinaryHTTP.RunImport();
                ShowPageServerStatus();
                DialogProcess();
            });
            menu.Add(btnRetryUnlinkedFiles, () =>
            {
                JMMServerVM.Instance.clientBinaryHTTP.RescanUnlinkedFiles();
                ShowPageServerStatus();
                DialogProcess();
            });
            menu.Add(btnRemoveRecords, RemoveMissingFiles);
            menu.Add(btnScanDropFolder, ScanDropFolder);
            menu.Add(btnSyncVotes, SyncVotes);
            menu.Add(btnSyncMyList, SyncMyList);
            menu.AddContext(btnMoreOptions, ShowMoreOptionsMenu);
            if (menu.Check(control))
                return;

            if (actionType == Action.ActionType.ACTION_SELECT_ITEM)
                OnShowContextMenu();

            base.OnClicked(controlId, control, actionType);
        }
开发者ID:japanesemediamanager,项目名称:animeplugin3,代码行数:37,代码来源:AdminWindow.cs

示例3: OnClicked

        protected override void OnClicked(int controlId, GUIControl control, MediaPortal.GUI.Library.Action.ActionType actionType)
        {
            //BaseConfig.MyAnimeLog.Write("OnClicked: {0}", controlId.ToString());

            MainMenu menu = new MainMenu();
            menu.Add(btnGetMissingInfo, () =>
            {
                SetGUIProperty(GuiProperty.Related_DownloadStatus, Translation.WaitingOnServer + "...");
                m_Facade.Focus = true;
                MainWindow.ServerHelper.DownloadRelatedAnime(mainAnime.AnimeID);
            });
            if (menu.Check(control))
                return;

            if (control == this.m_Facade)
            {
                AniDB_Anime_RelationVM ra = m_Facade.SelectedListItem.TVTag as AniDB_Anime_RelationVM;
                if (ra != null && ra.AnimeSeries != null && ra.AnimeSeries.AnimeSeriesID.HasValue)
                {
                    // show relations for this anime
                    MainWindow.GlobalSeriesID = ra.AnimeSeries.AnimeSeriesID.Value;
                    GUIWindowManager.CloseCurrentWindow();
                    GUIWindowManager.ActivateWindow(Constants.WindowIDs.RELATIONS, false);
                }
                else
                {
                    Utils.DialogMsg(Translation.Error, Translation.YouDontHaveTheSeries);
                    return;
                }
            }

            base.OnClicked(controlId, control, actionType);
        }
开发者ID:japanesemediamanager,项目名称:animeplugin3,代码行数:33,代码来源:RelationsWindow.cs


注:本文中的MainMenu.Add方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。