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

Diff of /trunk/xmltv_parser/main.cs

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 44 by william, Fri Mar 8 03:36:44 2013 UTC revision 46 by william, Fri Mar 8 04:01:25 2013 UTC
# Line 17  namespace xmltv_parser Line 17  namespace xmltv_parser
17  {  {
18      public partial class main : Form      public partial class main : Form
19      {      {
20            bool form_closing = false;
21          private IXMLTVRuntimeInstance xmltv;          private IXMLTVRuntimeInstance xmltv;
22          private bool IsUnix          private bool IsUnix
23          {          {
# Line 93  namespace xmltv_parser Line 94  namespace xmltv_parser
94              //var program_count = p.Programs.Values.Count;              //var program_count = p.Programs.Values.Count;
95              //var program_list = p.Programs.Values.ToList().OrderBy(s => s.Start);              //var program_list = p.Programs.Values.ToList().OrderBy(s => s.Start);
96              ////Programs = program_list(0, program_count).ToList();              ////Programs = program_list(0, program_count).ToList();
97              //Programs = new List<IXMLTVProgram>(program_list.ToArray());              //Programs = new List<IXMLTVProgram>(program_list.ToArray());            
98                xmltv = XMLTV.CreateInstance(schedule_xml, new EventHandler<CancelEventArgs>(xmltv_cancelevent));
             xmltv = XMLTV.CreateInstance(schedule_xml);  
99              var program_count = xmltv.Programs.Values.Count;              var program_count = xmltv.Programs.Values.Count;
100              var program_list = xmltv.Programs.Values.ToList().OrderBy(s => s.Start);              var program_list = xmltv.Programs.Values.ToList().OrderBy(s => s.Start);
101              //Programs = program_list(0, program_count).ToList();              //Programs = program_list(0, program_count).ToList();
102              Programs = new List<IXMLTVProgram>(program_list.ToArray());              Programs = new List<IXMLTVProgram>(program_list.ToArray());
103          }          }
104    
105            void xmltv_cancelevent(object sender, CancelEventArgs e)
106            {
107                if (form_closing)
108                {
109                    e.Cancel = true;
110                }
111            }
112    
113          void CreateControls()          void CreateControls()
114          {          {
115              foreach (var program in Programs)              foreach (var program in Programs)
# Line 168  namespace xmltv_parser Line 176  namespace xmltv_parser
176    
177          private void main_FormClosing(object sender, FormClosingEventArgs e)          private void main_FormClosing(object sender, FormClosingEventArgs e)
178          {          {
179              if (xmltv != null)              form_closing = true;
             {  
                 xmltv.Dispose();  
             }  
180          }          }
181      }      }
182  }  }

Legend:
Removed from v.44  
changed lines
  Added in v.46

  ViewVC Help
Powered by ViewVC 1.1.22