/[xmltv_parser]/trunk/xmltv_parser/ProgramEntryControl.cs
ViewVC logotype

Annotation of /trunk/xmltv_parser/ProgramEntryControl.cs

Parent Directory Parent Directory | Revision Log Revision Log


Revision 148 - (hide annotations) (download)
Thu Mar 14 15:24:51 2013 UTC (6 years, 11 months ago) by william
File size: 1996 byte(s)

1 william 147 using System;
2     using System.Collections.Generic;
3     using System.ComponentModel;
4     using System.Drawing;
5     using System.Data;
6     using System.Linq;
7     using System.Text;
8     using System.Windows.Forms;
9     using libxmltv.Interfaces;
10    
11     namespace xmltv_parser
12     {
13     public partial class ProgramEntryControl : UserControl
14     {
15     IProgramDefinition program;
16     public ProgramEntryControl() : this(null) { }
17     public ProgramEntryControl(IProgramDefinition program)
18     {
19     InitializeComponent();
20     this.program = program;
21     LoadProgramInformation();
22     }
23    
24     private void LoadProgramInformation()
25     {
26     if (this.program == null) { return; }
27     //txtProgramTitle.Text = this.program.Title;
28     ////txtProgramSubTitle.Text = this.program.SubTitle;
29     //txtProgramDescription.Text = this.program.Description;
30    
31     DateTime start = DateTime.Parse(this.program.Start);
32     DateTime stop = DateTime.Parse(this.program.Stop);
33     TimeSpan length = (stop - start);
34     //string channel = string.Format("{0}:{1}", this.program.ChannelNumber, this.program.ChannelName);
35 william 148 string runtime = string.Format("{0}min", length.TotalMinutes);
36 william 147 //txtProgramAirTime.Text = string.Format("{0}{1}{2}", start.ToString("hh:mm tt (dddd dd/yyyy)"), channel, runtime);
37    
38     txtProgramTitle.Text = string.Format("{0}: {1}", this.program.Title, this.program.SubTitle);
39     txtProgramDescription.Text = string.Format(" {0}", this.program.Description);
40 william 148 txtProgramAirTime.Text = string.Format(" Airs: {0} at {1} on channel: {2} ({3}) ({4})", start.ToString("dddd (MM/dd/yyyy)"), start.ToString("hh:mm tt"), this.program.ChannelNumber, this.program.ChannelName, runtime);
41 william 147 }
42    
43     private void ProgramEntryControl_Load(object sender, EventArgs e)
44     {
45     this.Focus();
46     }
47     }
48     }

  ViewVC Help
Powered by ViewVC 1.1.22