本文整理汇总了C#中TvDatabase.TvBusinessLayer.CreateGroup方法的典型用法代码示例。如果您正苦于以下问题:C# TvBusinessLayer.CreateGroup方法的具体用法?C# TvBusinessLayer.CreateGroup怎么用?C# TvBusinessLayer.CreateGroup使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TvDatabase.TvBusinessLayer
的用法示例。
在下文中一共展示了TvBusinessLayer.CreateGroup方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Main
//.........这里部分代码省略.........
"DB recreation needed", MessageBoxButtons.OKCancel, MessageBoxIcon.Question,
MessageBoxDefaultButton.Button2) == DialogResult.Cancel)
return;
Log.Info("---- create database ----");
if (!dlg.ExecuteSQLScript("create"))
{
MessageBox.Show("Failed to create the database.", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
return;
}
Log.Info("- Database created.");
currentSchemaVersion = dlg.GetCurrentShemaVersion(startupMode);
}
Log.Info("---- upgrade database schema ----");
// Get MySQL server version
string currentServerVersion = dlg.GetCurrentServerVersion(startupMode);
if (!dlg.UpgradeDBSchema(currentSchemaVersion, currentServerVersion))
{
MessageBox.Show("Failed to upgrade the database.", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
return;
}
Log.Info("---- check if tvservice is running ----");
if (!ServiceHelper.IsRunning)
{
Log.Info("---- tvservice is not running ----");
if (startupMode != StartupMode.DeployMode)
{
DialogResult result = MessageBox.Show("The Tv service is not running.\rStart it now?",
"Mediaportal TV service", MessageBoxButtons.YesNo);
if (result != DialogResult.Yes) return;
}
Log.Info("---- start tvservice----");
ServiceHelper.Start();
}
ServiceHelper.WaitInitialized();
int cards = 0;
try
{
cards = RemoteControl.Instance.Cards;
}
catch (Exception)
{
Log.Info("---- restart tvservice----");
ServiceHelper.Restart();
ServiceHelper.WaitInitialized();
try
{
RemoteControl.Clear();
RemoteControl.HostName = Dns.GetHostName();
cards = RemoteControl.Instance.Cards;
}
catch (Exception ex)
{
Log.Info("---- Unable to restart tv service----");
Log.Write(ex);
MessageBox.Show("Failed to startup tvservice" + ex);
return;
}
}
var layer = new TvBusinessLayer();
layer.SetLogLevel();
// Mantis #0001991: disable mpg recording (part I: force TS recording format)
IList<Card> TvCards = Card.ListAll();
foreach (Card card in TvCards)
{
if (card.RecordingFormat != 0)
{
card.RecordingFormat = 0;
Log.Info("Card {0} switched from .MPG to .TS format", card.Name);
card.Persist();
}
}
// Mantis #0002138: impossible to configure TVGroups
layer.CreateGroup(TvConstants.TvGroupNames.AllChannels);
// Avoid the visual part of SetupTv if in DeployMode
if (startupMode == StartupMode.DeployMode)
{
return;
}
try
{
AppDomain.CurrentDomain.AssemblyResolve += CurrentDomain_AssemblyResolve;
Application.EnableVisualStyles();
Application.DoEvents();
new Startup().Start();
}
catch (Exception ex)
{
Log.Write(ex);
}
}