コード例 #1
0
ファイル: EPG_Control_V3.cs プロジェクト: hirec/SmartHome
 public EPG_Control_V3(string SourceDirectory)
 {
   this.sourceDirectory = SourceDirectory;
   currentTime = DateTime.Now;
   lastTime = DateTime.Now.AddHours(4);
   incrementalTime = new System.TimeSpan(0, 30, 0);
   epg_Data = new EPG_Program_Channel();
   epg_Times = new EPG_Time();
   epg_SelectedItem = new EPG_SelectedItem();
   tvdbHandler = new TvdbHandler(new XmlCacheProvider("C:\\test"), "572328F18DC4374A");
   tvdbHandler.InitCache();
   client = new TMDbClient("ecaa9ae8c8346269b53c80e2a61aa0ea");
   client.GetConfig();
   epg_ChannelIndex = 0;
   epg_ProgramIndex = 0;
 }
コード例 #2
0
ファイル: EPG_VM.cs プロジェクト: hirec/SmartHome
 public async void Startup()
 {
   //REGISTER FOR ANY MESSAGES AND INITIALIZE ANY ITEMS      
   Messenger.Default.Register<string>(this, "TVCC", setActiveStatus);
   guideLoadedSuccessfuly = false;
   delayItemUpdateTimer = new System.Timers.Timer(500);
   delayItemUpdateTimer.Elapsed += new ElapsedEventHandler(DelayedItemUpdate);
   //Load Default Directory
   string sourceApplication = System.IO.Directory.GetCurrentDirectory();
   int removeIndex = sourceApplication.IndexOf("SmartHome\\bin\\Debug");
   int removeLength = sourceApplication.Length - removeIndex;
   sourceDirectory = sourceApplication.Substring(0, removeIndex);
   EPG_Ctrl = new EPG_Control_V4(sourceDirectory);
   EPG_Data = await Task.Run(() => EPG_Ctrl.LoadGuide());
   EPGTimeLine = await Task.Run(() => EPG_Ctrl.setEPG_Times());
   EPG_Item = await Task.Run(() => EPG_Ctrl.UpdateSelectedItem());
   EPG_ItemImageSource = await Task.Run(() => EPG_Ctrl.UpdateSelectedItemImage());
   guideLoadedSuccessfuly = true;   
 }
コード例 #3
0
ファイル: EPG_Control_V4.cs プロジェクト: hirec/SmartHome
 public EPG_Control_V4(string SourceDirectory)
 {
   this.sourceDirectory = SourceDirectory;;
   if (DateTime.Now.Minute < 30)
     currentTime = DateTime.Now.AddMinutes(-DateTime.Now.Minute);
   else
     currentTime = DateTime.Now.AddMinutes(30 - DateTime.Now.Minute);
   currentSelectedTime = currentTime;
   lastTime = currentTime.AddHours(2);
   currentChannel = 0;
   lastChannel = 2;
   incrementalTime = new System.TimeSpan(0, 30, 0);
   epg_Data = new EPG_Program_Channel();
   epg_Times = new EPG_Time();
   epg_SelectedItem = new EPG_SelectedItem();
   tvdbHandler = new TvdbHandler(new XmlCacheProvider("C:\\test"), "572328F18DC4374A");
   tvdbHandler.InitCache();
   client = new TMDbClient("ecaa9ae8c8346269b53c80e2a61aa0ea");
   client.GetConfig();
 }
コード例 #4
0
ファイル: EPG_Control_V2.cs プロジェクト: hirec/SmartHome
    public EPG_Control_V2(string SourceDirectory)
    {
      this.sourceDirectory = SourceDirectory;
      epg_Data = new EPG_Program_Channel();
      epg_Times = new EPG_Time();
      epg_SelectedItem = new EPG_SelectedItem();
      tvdbHandler = new TvdbHandler(new XmlCacheProvider("C:\\test"), "572328F18DC4374A");
      tvdbHandler.InitCache();
      client = new TMDbClient("ecaa9ae8c8346269b53c80e2a61aa0ea");
      client.GetConfig();
      epg_ChannelIndex = 0;
      epg_ProgramIndex = 0;
      incTimeSpan = new TimeSpan(0, 30, 0);
      int ts = 0;

      if (DateTime.Now.Minute < 30)      
        ts = -(DateTime.Now.Minute);      
      else      
        ts = 30 - DateTime.Now.Minute;        
      
      currentTime = DateTime.Now.AddMinutes(ts);
      lastTime = currentTime.AddHours(2);
    }
コード例 #5
0
ファイル: EPG_VM.cs プロジェクト: hirec/SmartHome
 private async void shell_KeyDown(KeyEventArgs e)
 {
   int num;
   string numKey = e.Key.ToString().Substring(e.Key.ToString().Length - 1);
   if (int.TryParse(numKey, out num))
   {
    //Start delay and then navigate EPG to selected channel.
   }
   else
   {
     switch (e.Key)
     {
       case Key.Left:           
           EPG_Data = await Task.Run(() => EPG_Ctrl.Navigate_Item("Left"));
           EPGTimeLine = await Task.Run(() => EPG_Ctrl.updateEPG_Times());
           EPG_Item = await Task.Run(() => EPG_Ctrl.UpdateSelectedItem());
           ResetItemUpdateTimer(); //THIS WILL UPDATE SELECTED ITEM IMAGE AFTER DELAY SET ON STARTUP            
         break;
       case Key.Right:            
           EPG_Data = await Task.Run(() => EPG_Ctrl.Navigate_Item("Right"));
           EPGTimeLine = await Task.Run(() => EPG_Ctrl.updateEPG_Times());
           EPG_Item = await Task.Run(() => EPG_Ctrl.UpdateSelectedItem());
           ResetItemUpdateTimer(); //THIS WILL UPDATE SELECTED ITEM IMAGE AFTER DELAY SET ON STARTUP            
         break;
       case Key.Up:           
           EPG_Data = await Task.Run(() => EPG_Ctrl.Navigate_Item("Up"));
           EPG_Item = await Task.Run(() => EPG_Ctrl.UpdateSelectedItem());
           ResetItemUpdateTimer(); //THIS WILL UPDATE SELECTED ITEM IMAGE AFTER DELAY SET ON STARTUP   
         break;
       case Key.Down:           
           EPG_Data = await Task.Run(() => EPG_Ctrl.Navigate_Item("Down"));
           EPG_Item = await Task.Run(() => EPG_Ctrl.UpdateSelectedItem());
           ResetItemUpdateTimer(); //THIS WILL UPDATE SELECTED ITEM IMAGE AFTER DELAY SET ON STARTUP            
         break;
       case Key.Enter:
         Messenger.Default.Send(EPG_Ctrl.Selected_Channel,"EPGRequest_ChannelChange");           
         break;          
     }
   }
 }