Beispiel #1
0
 private void SetService()
 {
     this.serviceTimer.Enabled = false;
     this.sql.Text             = "select service.id, name, start, end, title, event1.id from service \r\n                        left join\r\n                        (select id,fsid, start,end, title from event\r\n                        where start < {1} and end > {1}) as event1\r\n                        on service.fsid = event1.fsid\r\n                        where driver = '{0}' \r\n                        order by service.id".Formatex(new object[]
     {
         Sql.SqlEncode(this.curTuner.Driver),
         DateTime.Now.Ticks
     });
     using (DataTable table = this.sql.GetTable())
     {
         this.services.Clear();
         while (table.Read())
         {
             TunerMon.ServiceInfo serviceInfo = new TunerMon.ServiceInfo();
             serviceInfo.Id   = table.GetInt(0);
             serviceInfo.Name = table.GetStr(1);
             if (!table.IsNull(2))
             {
                 DateTime dateTime  = new DateTime(table.GetLong(2));
                 DateTime dateTime2 = new DateTime(table.GetLong(3));
                 serviceInfo.EventTime  = dateTime.ToString("HH:mm") + "-" + dateTime2.ToString("HH:mm");
                 serviceInfo.EventTitle = table.GetStr(4);
                 serviceInfo.EventId    = table.GetInt(5);
             }
             this.services.Add(serviceInfo);
         }
     }
     this.serviceView.VirtualListSize = this.services.Count;
     this.serviceTimer.Enabled        = true;
 }
Beispiel #2
0
 private void recordAddMenuItem_Click(object sender, EventArgs arg)
 {
     try
     {
         TunerMon.ServiceInfo serviceInfo = this.services[this.serviceView.FocusedItem.Index];
         if (serviceInfo.EventId == -1)
         {
             if (MessageBox.Show("番組情報が無いため予約できません。TVTestの録画機能で録画してください。TVTestを開きますか?", AppData.AppName, MessageBoxButtons.OKCancel) == DialogResult.OK)
             {
                 this.View();
             }
         }
         else
         {
             Record arg_5A_0 = new Record();
             Event  @event   = new Event(this.sql, serviceInfo.EventId);
             arg_5A_0.Fsid      = @event.Fsid;
             arg_5A_0.Eid       = @event.Eid;
             arg_5A_0.StartTime = @event.Start;
             arg_5A_0.Duration  = @event.Duration;
             arg_5A_0.Title     = @event.Title;
             arg_5A_0.Add(this.sql);
         }
     }
     catch (Exception ex)
     {
         Log.Write("予約できませんでした。[詳細] " + ex.Message);
         Log.Write(1, ex.StackTrace);
     }
 }
Beispiel #3
0
 private void serviceMenu_Opening(object sender, CancelEventArgs e)
 {
     this.EnableServiceMenu(this.serviceView.FocusedItem != null);
     if (this.serviceView.FocusedItem == null)
     {
         return;
     }
     TunerMon.ServiceInfo arg_3D_0 = this.services[this.serviceView.FocusedItem.Index];
     this.closeTunerMenuItem.Enabled = this.curTuner.IsOpen();
 }
Beispiel #4
0
 private void serviceView_RetrieveVirtualItem(object sender, RetrieveVirtualItemEventArgs e)
 {
     try
     {
         TunerMon.ServiceInfo serviceInfo  = this.services[e.ItemIndex];
         ListViewItem         listViewItem = new ListViewItem();
         listViewItem.Text = serviceInfo.Name;
         ListViewItem.ListViewSubItem item = new ListViewItem.ListViewSubItem(listViewItem, serviceInfo.EventTime);
         listViewItem.SubItems.Add(item);
         ListViewItem.ListViewSubItem item2 = new ListViewItem.ListViewSubItem(listViewItem, serviceInfo.EventTitle);
         listViewItem.SubItems.Add(item2);
         e.Item = listViewItem;
     }
     catch (Exception ex)
     {
         Log.Write(ex.Message);
         Log.Write(1, ex.StackTrace);
     }
 }