示例#1
0
 public static TunerMon GetInstance()
 {
     if (singleObj == null)
     {
         singleObj = new TunerMon();
     }
     return(singleObj);
 }
示例#2
0
 public TunerMon()
 {
     this.InitializeComponent();
     TunerMon.EnableDoubleBuffer(this.serviceView);
     try
     {
         this.LoadState();
         this.sql = new Sql(true);
         this.InitTunerView();
         base.ActiveControl = this.tunerView;
         if (this.tunerView.Nodes.Count > 0)
         {
             this.tunerView.SelectedNode = this.tunerView.Nodes[0];
         }
     }
     catch (Exception ex)
     {
         Log.Write("エラーが発生しました。[詳細] " + ex.Message);
         Log.Write(1, ex.StackTrace);
     }
 }
示例#3
0
        static void Main(string[] args)
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            WebServer ws = null;

            var ticket = new Ticket("/tvmaid/mutex/main");

            try
            {
                if (ticket.GetOwner(60 * 1000) == false)
                {
                    ticket = null;
                    throw new AppException("時間内に二重起動が解消されませんでした。");
                }

                Log.Write(AppVer);
                LoadDef();

                //先に読み込んでおく
                GenreConv.GetInstance();
                TextConv.GetInstance();

                if (args.Length == 1 && args[0] == "-tunerupdate")
                {
                    UpdateTuner();
                }

                TaskList.StartNew(() => { RecTimer.GetInstance().Start(); });
                ws = new WebServer();
                TaskList.StartNew(() => { ws.Start(); });

                TunerMon.GetInstance();
                Application.Run(new Tasktray());
            }
            catch (Exception e)
            {
                MessageBox.Show("このエラーは回復できないため、アプリケーションは終了します。[詳細]" + e.Message, Logo);
            }
            finally
            {
                if (ws != null)
                {
                    ws.Dispose();
                }
                RecTimer.GetInstance().Dispose();

                if (StateDef != null)
                {
                    StateDef.Save();
                }

                //スレッド終了待ち
                int i = 0;
                while (TaskList.GetInstance().IsFinish() == false)
                {
                    System.Threading.Thread.Sleep(100);
                    i++;
                    if (i > 300)
                    {
                        break;
                    }
                }
                if (ticket != null)
                {
                    ticket.Dispose();
                }
            }
        }
示例#4
0
 private void notifyIcon_DoubleClick(object sender, EventArgs e)
 {
     TunerMon.GetInstance().Show();
     TunerMon.GetInstance().Activate();
 }
示例#5
0
 private void tunerMonMenuItem_Click(object sender, EventArgs e)
 {
     TunerMon.GetInstance().Show();
 }