本文整理汇总了C#中TvDatabase.TvBusinessLayer.UpdateTuningDetails方法的典型用法代码示例。如果您正苦于以下问题:C# TvBusinessLayer.UpdateTuningDetails方法的具体用法?C# TvBusinessLayer.UpdateTuningDetails怎么用?C# TvBusinessLayer.UpdateTuningDetails使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TvDatabase.TvBusinessLayer
的用法示例。
在下文中一共展示了TvBusinessLayer.UpdateTuningDetails方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: DoScan
//.........这里部分代码省略.........
if (dbChannel.IsTv)
{
layer.AddChannelToGroup(dbChannel, TvConstants.TvGroupNames.AllChannels);
if (checkBoxCreateSignalGroup.Checked)
{
layer.AddChannelToGroup(dbChannel, TvConstants.TvGroupNames.DVBC);
}
if (checkBoxCreateGroups.Checked)
{
layer.AddChannelToGroup(dbChannel, channel.Provider);
}
}
if (dbChannel.IsRadio)
{
layer.AddChannelToRadioGroup(dbChannel, TvConstants.RadioGroupNames.AllChannels);
if (checkBoxCreateSignalGroup.Checked)
{
layer.AddChannelToRadioGroup(dbChannel, TvConstants.RadioGroupNames.DVBC);
}
if (checkBoxCreateGroups.Checked)
{
layer.AddChannelToRadioGroup(dbChannel, channel.Provider);
}
}
if (currentDetail == null)
{
layer.AddTuningDetails(dbChannel, channel);
}
else
{
//update tuning details...
TuningDetail td = layer.UpdateTuningDetails(dbChannel, channel, currentDetail);
td.Persist();
}
if (channel.IsTv)
{
if (exists)
{
tv.updChannel++;
}
else
{
tv.newChannel++;
tv.newChannels.Add(channel);
}
}
if (channel.IsRadio)
{
if (exists)
{
radio.updChannel++;
}
else
{
radio.newChannel++;
radio.newChannels.Add(channel);
}
}
layer.MapChannelToCard(card, dbChannel, false);
line = String.Format("{0}tp- {1} {2} {3}:New TV/Radio:{4}/{5} Updated TV/Radio:{6}/{7}", 1 + index,
tuneChannel.Frequency, tuneChannel.ModulationType, tuneChannel.SymbolRate,
tv.newChannel, radio.newChannel, tv.updChannel, radio.updChannel);
item.Text = line;
示例2: DoScan
//.........这里部分代码省略.........
if (currentDetail != null)
if (channel.Frequency != currentDetail.Frequency)
currentDetail = null;
bool exists;
if (currentDetail == null)
{
//add new channel
exists = false;
dbChannel = layer.AddNewChannel(channel.Name);
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);
}
if (currentDetail == null)
{
layer.AddTuningDetails(dbChannel, channel);
}
else
{
//update tuning details...
TuningDetail td = layer.UpdateTuningDetails(dbChannel, channel, currentDetail);
td.Persist();
}
if (channel.IsTv)
{
if (exists)
{
tvChannelsUpdated++;
updatedChannels++;
}
else
{
tvChannelsNew++;
newChannels++;
}
}
if (channel.IsRadio)
{
if (exists)
{
radioChannelsUpdated++;
updatedChannels++;
}
else
{
radioChannelsNew++;
newChannels++;
}
}
layer.MapChannelToCard(card, dbChannel, false);
line = String.Format("physical channel:{0} frequency:{1} modulation:{2} New:{3} Updated:{4}",
tuneChannel.PhysicalChannel, tuneChannel.Frequency, tuneChannel.ModulationType,
newChannels, updatedChannels);
item.Text = line;
}
}
//DatabaseManager.Instance.SaveChanges();
}
catch (Exception ex)
{
Log.Write(ex);
}
finally
{
IUser user = new User();
user.CardId = _cardNumber;
RemoteControl.Instance.StopCard(user);
RemoteControl.Instance.EpgGrabberEnabled = true;
progressBar1.Value = 100;
checkBoxQAM.Enabled = true;
mpComboBoxFrequencies.Enabled = true;
mpButtonScanTv.Text = buttonText;
_isScanning = false;
}
listViewStatus.Items.Add(
new ListViewItem(String.Format("Total radio channels new:{0} updated:{1}", radioChannelsNew,
radioChannelsUpdated)));
listViewStatus.Items.Add(
new ListViewItem(String.Format("Total tv channels new:{0} updated:{1}", tvChannelsNew, tvChannelsUpdated)));
ListViewItem lastItem = listViewStatus.Items.Add(new ListViewItem("Scan done..."));
lastItem.EnsureVisible();
}
示例3: DoScan
//.........这里部分代码省略.........
{
currentDetail = layer.GetTuningDetail(channel.Url, TvBusinessLayer.GetChannelType(channel));
}
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;
}
dbChannel.IsTv = channel.IsTv;
dbChannel.IsRadio = channel.IsRadio;
dbChannel.Persist();
}
else
{
exists = true;
dbChannel = currentDetail.ReferencedChannel();
}
layer.AddChannelToGroup(dbChannel, TvConstants.TvGroupNames.AllChannels);
if (checkBoxCreateGroups.Checked)
{
layer.AddChannelToGroup(dbChannel, channel.Provider);
}
if (currentDetail == null)
{
layer.AddTuningDetails(dbChannel, channel);
}
else
{
//update tuning details...
TuningDetail td = layer.UpdateTuningDetails(dbChannel, channel, currentDetail);
td.Persist();
}
if (channel.IsTv)
{
if (exists)
{
tvChannelsUpdated++;
updatedChannels++;
}
else
{
tvChannelsNew++;
newChannels++;
}
}
if (channel.IsRadio)
{
if (exists)
{
radioChannelsUpdated++;
updatedChannels++;
}
else
{
radioChannelsNew++;
newChannels++;
}
}
layer.MapChannelToCard(card, dbChannel, false);
line = String.Format("{0}- {1} :New:{2} Updated:{3}", 1 + index, tuneChannel.Name, newChannels,
updatedChannels);
item.Text = line;
}
}
//DatabaseManager.Instance.SaveChanges();
}
catch (Exception ex)
{
Log.Write(ex);
}
finally
{
RemoteControl.Instance.StopCard(user);
RemoteControl.Instance.EpgGrabberEnabled = true;
progressBar1.Value = 100;
mpComboBoxService.Enabled = true;
checkBoxCreateGroups.Enabled = true;
checkBoxEnableChannelMoveDetection.Enabled = true;
mpButtonScanTv.Text = buttonText;
_isScanning = false;
}
ListViewItem lastItem = listViewStatus.Items.Add(new ListViewItem("Scan done..."));
lastItem =
listViewStatus.Items.Add(
new ListViewItem(String.Format("Total radio channels new:{0} updated:{1}", radioChannelsNew,
radioChannelsUpdated)));
lastItem =
listViewStatus.Items.Add(
new ListViewItem(String.Format("Total tv channels new:{0} updated:{1}", tvChannelsNew, tvChannelsUpdated)));
lastItem.EnsureVisible();
}
示例4: DoScan
//.........这里部分代码省略.........
{
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);
}
if (currentDetail == null)
{
layer.AddTuningDetails(dbChannel, channel);
}
else
{
//update tuning details...
TuningDetail td = layer.UpdateTuningDetails(dbChannel, channel, currentDetail);
td.Persist();
}
if (channel.IsTv)
{
if (exists)
{
tvChannelsUpdated++;
updatedChannels++;
}
else
{
tvChannelsNew++;
newChannels++;
}
}
if (channel.IsRadio)
{
if (exists)
{
radioChannelsUpdated++;
updatedChannels++;
}
else
{
radioChannelsNew++;
newChannels++;
}
}
layer.MapChannelToCard(card, dbChannel, false);
}
line += string.Format("new = {0}, updated = {1}", newChannels, updatedChannels);
item.Text = line;
Log.Info("ATSC: scan result, new = {0}, updated = {1}", newChannels, updatedChannels);
}
}
catch (Exception ex)
{
Log.Write(ex);
}
finally
{
IUser user = new User();
user.CardId = _cardNumber;
RemoteControl.Instance.StopCard(user);
RemoteControl.Instance.EpgGrabberEnabled = true;
progressBar1.Value = 100;
mpComboBoxTuningMode.Enabled = true;
UpdateQamFrequencyFieldAvailability();
mpButtonScanTv.Text = buttonText;
_isScanning = false;
}
listViewStatus.Items.Add(
new ListViewItem(String.Format("Total radio channels, new = {0}, updated = {1}", radioChannelsNew,
radioChannelsUpdated)));
listViewStatus.Items.Add(
new ListViewItem(String.Format("Total TV channels, new = {0} updated = {1}", tvChannelsNew, tvChannelsUpdated)));
ListViewItem lastItem = listViewStatus.Items.Add(new ListViewItem("Scan done!"));
lastItem.EnsureVisible();
Log.Info("ATSC: scan summary, new TV = {0}, updated TV = {1}, new radio = {2}, updated radio = {3}", tvChannelsNew, tvChannelsUpdated, radioChannelsNew, radioChannelsUpdated);
}