本文整理匯總了C#中TvDatabase.Schedule.isSameTransponder方法的典型用法代碼示例。如果您正苦於以下問題:C# Schedule.isSameTransponder方法的具體用法?C# Schedule.isSameTransponder怎麽用?C# Schedule.isSameTransponder使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類TvDatabase.Schedule
的用法示例。
在下文中一共展示了Schedule.isSameTransponder方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。
示例1: AssignSchedulesToCard
private static bool AssignSchedulesToCard(Schedule schedule, List<Schedule>[] cardSchedules,
out List<Schedule> overlappingSchedules)
{
overlappingSchedules = new List<Schedule>();
Log.Info("AssignSchedulesToCard: schedule = " + schedule);
IList<Card> cards = Card.ListAll();
bool assigned = false;
int count = 0;
foreach (Card card in cards)
{
if (card.Enabled && card.canViewTvChannel(schedule.IdChannel))
{
// checks if any schedule assigned to this cards overlaps current parsed schedule
bool free = true;
foreach (Schedule assignedSchedule in cardSchedules[count])
{
Log.Info("AssignSchedulesToCard: card {0}, ID = {1} has schedule = " + assignedSchedule, count, card.IdCard);
bool hasOverlappingSchedule = schedule.IsOverlapping(assignedSchedule);
if (hasOverlappingSchedule)
{
bool isSameTransponder = (schedule.isSameTransponder(assignedSchedule) && card.supportSubChannels);
if (!isSameTransponder)
{
overlappingSchedules.Add(assignedSchedule);
Log.Info("AssignSchedulesToCard: overlapping with " + assignedSchedule + " on card {0}, ID = {1}", count,
card.IdCard);
free = false;
break;
}
}
}
if (free)
{
Log.Info("AssignSchedulesToCard: free on card {0}, ID = {1}", count, card.IdCard);
cardSchedules[count].Add(schedule);
assigned = true;
break;
}
}
count++;
}
if (!assigned)
{
return false;
}
return true;
}
示例2: AssignSchedulesToCard
//-------------------------------------------------------------------------------------------------------------
// assigns a single schedule to the card
//-------------------------------------------------------------------------------------------------------------
private static bool AssignSchedulesToCard(Schedule schedule, List<Schedule>[] cardSchedules, out Schedule overlappingSchedule,bool Debug)
{
overlappingSchedule = null;
//if (Debug==true)
// Log.Debug("AssignSchedulesToCard: schedule = " + schedule.ToString());
#if(TV100)
IList cards = Card.ListAll();
#elif(TV101 || TV11 || TV12)
IList<Card> cards = Card.ListAll();
#endif
bool assigned = false;
int count = 0;
foreach (Card card in cards)
{
//if (Debug == true)
// Log.Debug("Working on card: "+card.IdCard.ToString()+" ID Channel="+schedule.IdChannel.ToString());
if (card.canViewTvChannel(schedule.IdChannel))
{
// checks if any schedule assigned to this cards overlaps current parsed schedule
bool free = true;
// if (Debug == true)
// Log.Debug("card can view channel - free=true");
foreach (Schedule assignedSchedule in cardSchedules[count])
{
//if (Debug == true)
// Log.Debug("AssignSchedulesToCard: card {0}, ID = {1} has schedule = " + assignedSchedule, count, card.IdCard);
if (schedule.IsOverlapping(assignedSchedule))
{
//if (Debug == true)
// Log.Debug("schedule is overlapping - checking same transponder");
if (!(schedule.isSameTransponder(assignedSchedule) && card.supportSubChannels))
{
overlappingSchedule = assignedSchedule;
if (Debug == true)
Log.Debug("AssignSchedulesToCard: overlapping with " + assignedSchedule + " on card {0}, ID = {1}", card.IdCard);
free = false;
break;
}
}
}
if (free)
{
if (Debug == true)
Log.Debug("AssignSchedulesToCard: free on card "+count.ToString()+", ID = "+ card.IdCard.ToString());
cardSchedules[count].Add(schedule);
assigned = true;
break;
}
}
count++;
}
if (!assigned)
{
return false;
}
return true;
}