本文整理汇总了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);
}
示例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);
}
示例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);
}