本文整理汇总了C#中TvDatabase.TvBusinessLayer.GetProgramExists方法的典型用法代码示例。如果您正苦于以下问题:C# TvBusinessLayer.GetProgramExists方法的具体用法?C# TvBusinessLayer.GetProgramExists怎么用?C# TvBusinessLayer.GetProgramExists使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TvDatabase.TvBusinessLayer
的用法示例。
在下文中一共展示了TvBusinessLayer.GetProgramExists方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: OnGetIMDBInfo
private void OnGetIMDBInfo()
{
IMDBMovie movieDetails = new IMDBMovie();
movieDetails.SearchString = _currentProgram.Title;
if (IMDBFetcher.GetInfoFromIMDB(this, ref movieDetails, false, false))
{
TvBusinessLayer dbLayer = new TvBusinessLayer();
IList<Program> progs = dbLayer.GetProgramExists(Channel.Retrieve(_currentProgram.IdChannel),
_currentProgram.StartTime, _currentProgram.EndTime);
if (progs != null && progs.Count > 0)
{
Program prog = (Program)progs[0];
prog.Description = movieDetails.Plot;
// prog.Genre = movieDetails.Genre;
prog.StarRating = (int)movieDetails.Rating;
prog.Persist();
}
GUIVideoInfo videoInfo = (GUIVideoInfo)GUIWindowManager.GetWindow((int)Window.WINDOW_VIDEO_INFO);
videoInfo.AllocResources();
videoInfo.Movie = movieDetails;
GUIButtonControl btnPlay = (GUIButtonControl)videoInfo.GetControl(2);
if (btnPlay != null)
{
btnPlay.Visible = false;
}
GUICheckButton btnCast = (GUICheckButton)videoInfo.GetControl(4);
if (btnCast != null)
{
btnCast.Visible = false;
}
GUICheckButton btnWatched = (GUICheckButton)videoInfo.GetControl(6);
if (btnWatched != null)
{
btnWatched.Visible = false;
}
GUIWindowManager.ActivateWindow((int)Window.WINDOW_VIDEO_INFO);
}
else
{
Log.Info("IMDB Fetcher: Nothing found");
}
}