17 |
|
{ |
18 |
|
public partial class main : Form |
19 |
|
{ |
20 |
+ |
private IXMLTVRuntimeInstance xmltv; |
21 |
|
private bool IsUnix |
22 |
|
{ |
23 |
|
get { return System.Environment.OSVersion.Platform == PlatformID.Unix; } |
95 |
|
////Programs = program_list(0, program_count).ToList(); |
96 |
|
//Programs = new List<IXMLTVProgram>(program_list.ToArray()); |
97 |
|
|
98 |
< |
IXMLTVRuntimeInstance xmltv = XMLTV.CreateInstance(schedule_xml); |
98 |
> |
xmltv = XMLTV.CreateInstance(schedule_xml); |
99 |
|
var program_count = xmltv.Programs.Values.Count; |
100 |
|
var program_list = xmltv.Programs.Values.ToList().OrderBy(s => s.Start); |
101 |
|
//Programs = program_list(0, program_count).ToList(); |
165 |
|
catch (Exception ex) { gLog.Log.Error.WriteLine(ex.ToString()); MessageBox.Show(ex.Message, "Failed to save data", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } |
166 |
|
MessageBox.Show("Successfully saved data", "Successfully saved data", MessageBoxButtons.OK, MessageBoxIcon.Information); |
167 |
|
} |
168 |
+ |
|
169 |
+ |
private void main_FormClosing(object sender, FormClosingEventArgs e) |
170 |
+ |
{ |
171 |
+ |
if (xmltv != null) |
172 |
+ |
{ |
173 |
+ |
xmltv.Dispose(); |
174 |
+ |
} |
175 |
+ |
} |
176 |
|
} |
177 |
|
} |
178 |
|
|