本文整理汇总了C#中TvDatabase.TvBusinessLayer.GetTuningChannel方法的典型用法代码示例。如果您正苦于以下问题:C# TvBusinessLayer.GetTuningChannel方法的具体用法?C# TvBusinessLayer.GetTuningChannel怎么用?C# TvBusinessLayer.GetTuningChannel使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TvDatabase.TvBusinessLayer
的用法示例。
在下文中一共展示了TvBusinessLayer.GetTuningChannel方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: DoScan
//.........这里部分代码省略.........
ListViewItem item = listViewStatus.Items.Add(new ListViewItem(line));
item.EnsureVisible();
if (index == minchan)
{
RemoteControl.Instance.Scan(ref user, tuneChannel, -1);
}
IChannel[] channels = RemoteControl.Instance.Scan(_cardNumber, tuneChannel);
UpdateStatus();
if (channels == null || channels.Length == 0)
{
if (tuneChannel.PhysicalChannel > 0 && !RemoteControl.Instance.TunerLocked(_cardNumber))
{
line += "no signal";
}
else
{
line += "signal locked, no channels found";
}
item.Text = line;
item.ForeColor = Color.Red;
continue;
}
int newChannels = 0;
int updatedChannels = 0;
for (int i = 0; i < channels.Length; ++i)
{
Channel dbChannel;
ATSCChannel channel = (ATSCChannel)channels[i];
//No support for channel moving, or merging with existing channels here.
//We do not know how ATSC works to correctly implement this.
TuningDetail currentDetail = layer.GetTuningDetail(channel);
if (currentDetail != null)
{
if (channel.IsDifferentTransponder(layer.GetTuningChannel(currentDetail)))
{
currentDetail = null;
}
}
bool exists;
if (currentDetail == null)
{
//add new channel
exists = false;
dbChannel = layer.AddNewChannel(channel.Name, channel.LogicalChannelNumber);
dbChannel.SortOrder = 10000;
if (channel.LogicalChannelNumber >= 1)
{
dbChannel.SortOrder = channel.LogicalChannelNumber;
}
}
else
{
exists = true;
dbChannel = currentDetail.ReferencedChannel();
}
dbChannel.IsTv = channel.IsTv;
dbChannel.IsRadio = channel.IsRadio;
dbChannel.Persist();
if (dbChannel.IsTv)
{
layer.AddChannelToGroup(dbChannel, TvConstants.TvGroupNames.AllChannels);
}
if (dbChannel.IsRadio)
{
layer.AddChannelToRadioGroup(dbChannel, TvConstants.RadioGroupNames.AllChannels);
}