本文整理汇总了C#中TvControl.TvServer.IsRecordingSchedule方法的典型用法代码示例。如果您正苦于以下问题:C# TvServer.IsRecordingSchedule方法的具体用法?C# TvServer.IsRecordingSchedule怎么用?C# TvServer.IsRecordingSchedule使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TvControl.TvServer
的用法示例。
在下文中一共展示了TvServer.IsRecordingSchedule方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: PromptDeleteRecording
private static bool PromptDeleteRecording(int idSchedule, Program prg)
{
bool confirmed = false;
bool isRec = false;
if (prg != null)
{
isRec = TvDatabase.Schedule.IsScheduleRecording(idSchedule, prg);
}
else
{
var tvServer = new TvServer();
VirtualCard vCard;
isRec = tvServer.IsRecordingSchedule(idSchedule, out vCard);
}
if (isRec)
{
confirmed = SetupConfirmDelRecDialogue();
}
else
{
confirmed = true;
}
return confirmed;
}
示例2: OnClick
private void OnClick(int iItem)
{
m_iSelectedItem = GetSelectedItemNo();
GUIListItem item = GetItem(iItem);
if (item == null)
{
return;
}
Schedule rec = (Schedule)item.TVTag;
GUIDialogMenu dlg = (GUIDialogMenu)GUIWindowManager.GetWindow((int)Window.WINDOW_DIALOG_MENU);
if (dlg == null)
{
return;
}
dlg.Reset();
dlg.SetHeading(rec.ProgramName);
if (rec.Series == false)
{
dlg.AddLocalizedString(618); //delete
}
else
{
dlg.AddLocalizedString(981); //Delete this recording
dlg.AddLocalizedString(982); //Delete series recording
dlg.AddLocalizedString(888); //Episodes management
}
VirtualCard card;
TvServer server = new TvServer();
if (server.IsRecordingSchedule(rec.IdSchedule, out card))
{
dlg.AddLocalizedString(979); //Play recording from beginning
dlg.AddLocalizedString(980); //Play recording from live point
}
else
{
IList<TuningDetail> details = Channel.Retrieve(rec.IdChannel).ReferringTuningDetail();
foreach (TuningDetail detail in details)
{
if (detail.ChannelType == 0)
{
dlg.AddLocalizedString(882); //Quality settings
break;
}
}
}
dlg.DoModal(GetID);
if (dlg.SelectedLabel == -1)
{
return;
}
switch (dlg.SelectedId)
{
case 888: ////Episodes management
OnSetEpisodesToKeep(rec);
break;
case 882:
OnSetQuality(rec);
break;
case 981: //Delete this recording only
{
if (server.IsRecordingSchedule(rec.IdSchedule, out card))
{
GUIDialogYesNo dlgYesNo = (GUIDialogYesNo)GUIWindowManager.GetWindow((int)Window.WINDOW_DIALOG_YES_NO);
if (null != dlgYesNo)
{
dlgYesNo.SetHeading(GUILocalizeStrings.Get(653)); //Delete this recording?
dlgYesNo.SetLine(1, GUILocalizeStrings.Get(730)); //This schedule is recording. If you delete
dlgYesNo.SetLine(2, GUILocalizeStrings.Get(731)); //the schedule then the recording is stopped.
dlgYesNo.SetLine(3, GUILocalizeStrings.Get(732)); //are you sure
dlgYesNo.DoModal(GUIWindowManager.ActiveWindow);
if (dlgYesNo.IsConfirmed)
{
server.StopRecordingSchedule(rec.IdSchedule);
CanceledSchedule schedule = new CanceledSchedule(rec.IdSchedule, rec.IdChannel, rec.StartTime);
rec.Persist();
server.OnNewSchedule();
}
}
}
else
{
server.StopRecordingSchedule(rec.IdSchedule);
CanceledSchedule schedule = new CanceledSchedule(rec.IdSchedule, rec.IdChannel, rec.StartTime);
rec.Persist();
server.OnNewSchedule();
}
LoadDirectory();
}
break;
case 982: //Delete series recording
goto case 618;
case 618: // delete entire recording
//.........这里部分代码省略.........
示例3: LoadDirectory
private void LoadDirectory()
{
GUIControl.ClearControl(GetID, listPriorities.GetID);
SqlBuilder sb = new SqlBuilder(StatementType.Select, typeof (Schedule));
sb.AddOrderByField(false, "priority");
SqlStatement stmt = sb.GetStatement(true);
IList itemlist = ObjectFactory.GetCollection(typeof (Schedule), stmt.Execute());
int total = 0;
foreach (Schedule rec in itemlist)
{
if (rec.IsSerieIsCanceled(rec.StartTime, rec.IdChannel))
{
continue;
}
GUIListItem item = new GUIListItem();
item.Label = String.Format("{0}.{1}", total, rec.ProgramName);
item.TVTag = rec;
string strLogo = Utils.GetCoverArt(Thumbs.TVChannel, rec.ReferencedChannel().DisplayName);
if (string.IsNullOrEmpty(strLogo))
{
strLogo = "defaultVideoBig.png";
}
TvServer server = new TvServer();
VirtualCard card;
if (server.IsRecordingSchedule(rec.IdSchedule, out card))
{
if (rec.ScheduleType != (int)ScheduleRecordingType.Once)
{
item.PinImage = Thumbs.TvRecordingSeriesIcon;
}
else
{
item.PinImage = Thumbs.TvRecordingIcon;
}
}
else if (rec.ReferringConflicts().Count > 0)
{
item.PinImage = Thumbs.TvConflictRecordingIcon;
}
item.ThumbnailImage = strLogo;
item.IconImageBig = strLogo;
item.IconImage = strLogo;
listPriorities.Add(item);
total++;
}
//set object count label
GUIPropertyManager.SetProperty("#itemcount", Utils.GetObjectCountLabel(total));
GUIControl.SelectItemControl(GetID, listPriorities.GetID, m_iSelectedItem);
}
示例4: SetLabels
private void SetLabels()
{
for (int i = 0; i < GetItemCount(); ++i)
{
GUIListItem item = GetItem(i);
Schedule rec = (Schedule)item.TVTag;
//@
/*
switch (rec.Status)
{
case Schedule.RecordingStatus.Waiting:
item.Label3 = GUILocalizeStrings.Get(681);//waiting
break;
case Schedule.RecordingStatus.Finished:
item.Label3 = GUILocalizeStrings.Get(683);//Finished
break;
case Schedule.RecordingStatus.Canceled:
item.Label3 = GUILocalizeStrings.Get(684);//Canceled
break;
}*/
// check with recorder.
VirtualCard card;
TvServer server = new TvServer();
if (server.IsRecordingSchedule(rec.IdSchedule, out card))
{
item.Label3 = GUILocalizeStrings.Get(682); //Recording
if (rec.ScheduleType != (int)ScheduleRecordingType.Once)
{
item.PinImage = Thumbs.TvRecordingSeriesIcon;
}
else
{
item.PinImage = Thumbs.TvRecordingIcon;
}
}
else if (rec.ReferringConflicts().Count > 0)
{
item.PinImage = Thumbs.TvConflictRecordingIcon;
}
else
{
item.PinImage = String.Empty;
}
string strType = String.Empty;
item.Label = rec.ProgramName;
string strTime = String.Format("{0} {1} - {2}",
rec.StartTime.ToShortDateString(),
rec.StartTime.ToString("t", CultureInfo.CurrentCulture.DateTimeFormat),
rec.EndTime.ToString("t", CultureInfo.CurrentCulture.DateTimeFormat));
string day;
switch ((ScheduleRecordingType)rec.ScheduleType)
{
case ScheduleRecordingType.Once:
item.Label2 = String.Format("{0} {1} - {2}",
Utils.GetShortDayString(rec.StartTime),
rec.StartTime.ToString("t", CultureInfo.CurrentCulture.DateTimeFormat),
rec.EndTime.ToString("t", CultureInfo.CurrentCulture.DateTimeFormat));
;
break;
case ScheduleRecordingType.Daily:
strTime = String.Format("{0}-{1}",
rec.StartTime.ToString("t", CultureInfo.CurrentCulture.DateTimeFormat),
rec.EndTime.ToString("t", CultureInfo.CurrentCulture.DateTimeFormat));
strType = GUILocalizeStrings.Get(648);
item.Label2 = String.Format("{0} {1}", strType, strTime);
break;
case ScheduleRecordingType.WorkingDays:
strTime = String.Format("{0}-{1} {2}-{3}",
GUILocalizeStrings.Get(WeekEndTool.GetText(DayType.FirstWorkingDay)),
GUILocalizeStrings.Get(WeekEndTool.GetText(DayType.LastWorkingDay)),
rec.StartTime.ToString("t", CultureInfo.CurrentCulture.DateTimeFormat),
rec.EndTime.ToString("t", CultureInfo.CurrentCulture.DateTimeFormat));
strType = GUILocalizeStrings.Get(648);
item.Label2 = String.Format("{0} {1}", strType, strTime);
break;
case ScheduleRecordingType.Weekends:
strTime = String.Format("{0}-{1} {2}-{3}",
GUILocalizeStrings.Get(WeekEndTool.GetText(DayType.FirstWeekendDay)),
GUILocalizeStrings.Get(WeekEndTool.GetText(DayType.LastWeekendDay)),
rec.StartTime.ToString("t", CultureInfo.CurrentCulture.DateTimeFormat),
rec.EndTime.ToString("t", CultureInfo.CurrentCulture.DateTimeFormat));
strType = GUILocalizeStrings.Get(649);
item.Label2 = String.Format("{0} {1}", strType, strTime);
break;
case ScheduleRecordingType.Weekly:
switch (rec.StartTime.DayOfWeek)
{
case DayOfWeek.Monday:
day = GUILocalizeStrings.Get(11);
break;
case DayOfWeek.Tuesday:
day = GUILocalizeStrings.Get(12);
break;
case DayOfWeek.Wednesday:
day = GUILocalizeStrings.Get(13);
//.........这里部分代码省略.........
示例5: GetSchedules
//.........这里部分代码省略.........
}
catch
{ // Occurs for example when a recording is pointing to a channel
// that is deleted in the meantime
channelname = sched.IdChannel.ToString();
}
try
{
strSchedId = sched.IdSchedule.ToString();
strStartTime = sched.StartTime.ToString("u");
strEndTime = sched.EndTime.ToString("u");
strIdChannel = sched.IdChannel.ToString();
strProgramName = sched.ProgramName;
IList<Program> progs = Schedule.GetProgramsForSchedule(sched);
IList<CanceledSchedule> canceled_progs = sched.ReferringCanceledSchedule();
if (kodiHasSeriesSupport == true && sched.ScheduleType != 0 /* Once */)
{
// return also the real schedule and not only the underlying programs
schedule = FormatSchedule(strSchedId, strStartTime, strEndTime, strIdChannel, channelname.Replace("|", ""),
strProgramName.Replace("|", ""), sched, strIsRecording, idProgram.ToString(), sched.Canceled, sched.IdParentSchedule, "", "");
schedlist.Add(schedule);
}
foreach (Program pr in progs)
{
DateTime dtCanceled = sched.Canceled;
int parentSchedule;
if (kodiHasSeriesSupport && sched.ScheduleType != 0 /* Once */)
{
// add the programs for this schedule as sub-timers in Kodi
parentSchedule = sched.IdSchedule;
}
else
{
parentSchedule = sched.IdParentSchedule;
}
strStartTime = pr.StartTime.ToString("u");
strEndTime = pr.EndTime.ToString("u");
strIdChannel = pr.IdChannel.ToString();
strProgramName = pr.Title;
if (pr.EpisodeName.Length > 0)
strProgramName += " - " + pr.EpisodeName;
if (pr.IsRecording)
strIsRecording = "True";
else strIsRecording = "False";
idProgram = pr.IdProgram;
// Check if this program is in the CanceledSchedule list
foreach (CanceledSchedule cs in canceled_progs)
{
if (cs.CancelDateTime == pr.StartTime)
{
dtCanceled = cs.CancelDateTime;
break;
}
}
schedule = FormatSchedule(strSchedId, strStartTime, strEndTime, strIdChannel, channelname.Replace("|", ""),
strProgramName.Replace("|", ""), sched, strIsRecording, idProgram.ToString(), dtCanceled, parentSchedule, pr.Genre, pr.Description);
schedlist.Add(schedule);
}
if (progs.Count == 0)
{
if ((ScheduleRecordingType)sched.ScheduleType != (ScheduleRecordingType.Once))
{
continue; //This timer does not resolve to a program. Do not return it until we have a state for it in XBMC.
}
else //If the schedule did not resolve to any program, typical when creating an Instant Recording from XBMC and the name does not match a program name.
{
VirtualCard card;
TvControl.TvServer tv = new TvServer();
if (tv.IsRecordingSchedule(sched.IdSchedule, out card))
strIsRecording = "True";
idProgram = -1;
schedule = FormatSchedule(strSchedId, strStartTime, strEndTime, strIdChannel, channelname.Replace("|", ""),
strProgramName.Replace("|", ""), sched, strIsRecording, idProgram.ToString(), sched.Canceled, sched.IdParentSchedule, "", "");
schedlist.Add(schedule);
}
}
}
catch
{ }
}
}
catch (Exception ex)
{
lastException = ex;
Console.WriteLine(ex.ToString());
Log.Error("TVServerKodi: " + ex.ToString());
return null;
}
return schedlist;
}