本文整理汇总了C#中TvDatabase.TvBusinessLayer.GetPrograms方法的典型用法代码示例。如果您正苦于以下问题:C# TvBusinessLayer.GetPrograms方法的具体用法?C# TvBusinessLayer.GetPrograms怎么用?C# TvBusinessLayer.GetPrograms使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TvDatabase.TvBusinessLayer
的用法示例。
在下文中一共展示了TvBusinessLayer.GetPrograms方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: RenderSingleChannel
//void SetProperties()
protected override void RenderSingleChannel(Channel channel)
{
string strLogo;
int chan = ChannelOffset;
for (int iChannel = 0; iChannel < _channelCount; iChannel++)
{
if (chan < _channelList.Count)
{
Channel tvChan = _channelList[chan].channel;
strLogo = GetChannelLogo(tvChan.DisplayName);
GUIButton3PartControl img = GetControl(iChannel + (int)Controls.IMG_CHAN1) as GUIButton3PartControl;
if (img != null)
{
if (_showChannelLogos)
{
img.TexutureIcon = strLogo;
}
img.Label1 = tvChan.DisplayName;
img.Data = tvChan;
img.IsVisible = true;
}
}
chan++;
}
GUILabelControl channelLabel = GetControl((int)Controls.SINGLE_CHANNEL_LABEL) as GUILabelControl;
GUIImage channelImage = GetControl((int)Controls.SINGLE_CHANNEL_IMAGE) as GUIImage;
strLogo = GetChannelLogo(channel.DisplayName);
if (channelImage == null)
{
if (strLogo.Length > 0)
{
channelImage = new GUIImage(GetID, (int)Controls.SINGLE_CHANNEL_IMAGE,
GetControl((int)Controls.LABEL_TIME1).XPosition,
GetControl((int)Controls.LABEL_TIME1).YPosition - 15,
40, 40, strLogo, Color.White);
channelImage.AllocResources();
GUIControl temp = (GUIControl)channelImage;
Add(ref temp);
}
}
else
{
channelImage.SetFileName(strLogo);
}
if (channelLabel == null)
{
channelLabel = new GUILabelControl(GetID, (int)Controls.SINGLE_CHANNEL_LABEL,
channelImage.XPosition + 44,
channelImage.YPosition + 10,
300, 40, "font16", channel.DisplayName, 4294967295, GUIControl.Alignment.Left,
GUIControl.VAlignment.Top,
true, 0, 0, 0xFF000000);
channelLabel.AllocResources();
GUIControl temp = channelLabel;
Add(ref temp);
}
setSingleChannelLabelVisibility(true);
channelLabel.Label = channel.DisplayName;
if (strLogo.Length > 0)
{
channelImage.SetFileName(strLogo);
}
if (channelLabel != null)
{
channelLabel.Label = channel.DisplayName;
}
if (_recalculateProgramOffset)
{
_programs = new List<Program>();
DateTime dtStart = DateTime.Now;
dtStart = dtStart.AddDays(-1);
DateTime dtEnd = dtStart.AddDays(30);
TvBusinessLayer layer = new TvBusinessLayer();
_programs = layer.GetPrograms(channel, dtStart, dtEnd);
_totalProgramCount = _programs.Count;
if (_totalProgramCount == 0)
{
_totalProgramCount = _channelCount;
}
_recalculateProgramOffset = false;
bool found = false;
for (int i = 0; i < _programs.Count; i++)
{
Program program = (Program)_programs[i];
if (program.StartTime <= _viewingTime && program.EndTime >= _viewingTime)
{
//.........这里部分代码省略.........
示例2: OnAdvancedRecord
private void OnAdvancedRecord()
{
if (CurrentProgram == null)
{
return;
}
GUIDialogMenu dlg = (GUIDialogMenu)GUIWindowManager.GetWindow((int)Window.WINDOW_DIALOG_MENU);
if (dlg != null)
{
dlg.Reset();
dlg.SetHeading(GUILocalizeStrings.Get(616)); //616=Select Schedule type
//610=None
//611=Record once
//612=Record everytime on this channel
//613=Record everytime on every channel
//614=Record every week at this time
//615=Record every day at this time
for (int i = 611; i <= 615; ++i)
{
dlg.AddLocalizedString(i);
}
dlg.Add(GUILocalizeStrings.Get(WeekEndTool.GetText(DayType.Record_WorkingDays)));
dlg.Add(GUILocalizeStrings.Get(WeekEndTool.GetText(DayType.Record_WeekendDays)));
dlg.AddLocalizedString(990000); // 990000=Weekly everytime on this channel
dlg.DoModal(GetID);
if (dlg.SelectedLabel == -1)
{
return;
}
int scheduleType = (int)ScheduleRecordingType.Once;
switch (dlg.SelectedLabel)
{
case 0: //once
scheduleType = (int)ScheduleRecordingType.Once;
break;
case 1: //everytime, this channel
scheduleType = (int)ScheduleRecordingType.EveryTimeOnThisChannel;
break;
case 2: //everytime, all channels
scheduleType = (int)ScheduleRecordingType.EveryTimeOnEveryChannel;
break;
case 3: //weekly
scheduleType = (int)ScheduleRecordingType.Weekly;
break;
case 4: //daily
scheduleType = (int)ScheduleRecordingType.Daily;
break;
case 5: //WorkingDays
scheduleType = (int)ScheduleRecordingType.WorkingDays;
break;
case 6: //Weekends
scheduleType = (int)ScheduleRecordingType.Weekends;
break;
case 7://Weekly everytime, this channel
scheduleType = (int)ScheduleRecordingType.WeeklyEveryTimeOnThisChannel;
break;
}
CreateProgram(CurrentProgram, scheduleType, GetID);
if (scheduleType == (int)ScheduleRecordingType.Once)
{
//check if this program is interrupted (for example by a news bulletin)
//ifso ask the user if he wants to record the 2nd part also
DateTime dtStart = CurrentProgram.EndTime.AddMinutes(1);
DateTime dtEnd = dtStart.AddHours(3);
TvBusinessLayer layer = new TvBusinessLayer();
IList<Program> programs = layer.GetPrograms(CurrentProgram.ReferencedChannel(), dtStart, dtEnd);
if (programs.Count >= 2)
{
Program next = programs[0];
Program nextNext = programs[1];
if (nextNext.Title == CurrentProgram.Title)
{
TimeSpan ts = next.EndTime - nextNext.StartTime;
if (ts.TotalMinutes <= 40)
{
//
GUIDialogYesNo dlgYesNo = (GUIDialogYesNo)GUIWindowManager.GetWindow((int)Window.WINDOW_DIALOG_YES_NO);
dlgYesNo.SetHeading(1012); //This program will be interrupted by
dlgYesNo.SetLine(1, next.Title);
dlgYesNo.SetLine(2, 1013); //Would you like to record the second part also?
dlgYesNo.DoModal(GetID);
if (dlgYesNo.IsConfirmed)
{
CreateProgram(nextNext, scheduleType, GetID);
Update();
}
}
}
}
}
}
Update();
}
示例3: UpdateCurrentProgramTitle
private static void UpdateCurrentProgramTitle(ref Schedule recNew)
{
TvBusinessLayer layer = new TvBusinessLayer();
IList<Program> programs = layer.GetPrograms(recNew.ReferencedChannel(), recNew.StartTime, recNew.EndTime);
if (programs != null && programs.Count > 0)
{
recNew.ProgramName = programs[0].Title;
}
}