예제 #1
0
 public string PrintSubs(List <Subtitles> subs, int sec, int min, int hour, bool isFscroll)
 {
     if (isFscroll)
     {
         ScrollSubtitles scrolled = new ScrollSubtitles().GetScrolledSub(subs, sec, min, hour);
         endofsubs    = scrolled.Sentenceendmin;
         minoftext    = scrolled.Sentence;
         elementindex = scrolled.Index;
         return(minoftext);
     }
     else
     {
         if (Convert.ToDateTime(string.Format("{0}:{1}:{2}", hour, min, sec)) < Convert.ToDateTime(subs.ElementAt(elementindex).Timebegin))
         {
             if (endofsubs != string.Empty)
             {
                 if (Convert.ToDateTime(endofsubs) < Convert.ToDateTime(string.Format("{0}:{1}:{2}", hour, min, sec)))
                 {
                     minoftext = string.Empty;
                 }
             }
             return(minoftext);
         }
         else
         {
             minoftext     = subs.ElementAt(elementindex).Text;
             endofsubs     = subs.ElementAt(elementindex).Timeend;
             elementindex += 1;
             return(minoftext);
         }
     }
 }
예제 #2
0
 public string PrintSubs(List<Subtitles> subs, int sec, int min, int hour, bool isFscroll)
 {
     if (isFscroll)
     {
         ScrollSubtitles scrolled = new ScrollSubtitles().GetScrolledSub(subs,sec,min,hour);
         endofsubs = scrolled.Sentenceendmin;
         minoftext = scrolled.Sentence;
         elementindex = scrolled.Index;
         return minoftext;
     }
     else
     {
         if (Convert.ToDateTime(string.Format("{0}:{1}:{2}", hour, min, sec)) < Convert.ToDateTime(subs.ElementAt(elementindex).Timebegin))
         {
             if (endofsubs != string.Empty)
             {
                 if (Convert.ToDateTime(endofsubs) < Convert.ToDateTime(string.Format("{0}:{1}:{2}", hour, min, sec)))
                 {
                     minoftext = string.Empty;
                 }
             }
             return minoftext;
         }
         else
         {
             minoftext = subs.ElementAt(elementindex).Text;
             endofsubs = subs.ElementAt(elementindex).Timeend;
             elementindex += 1;
             return minoftext;
         }
     }
 }