37 |
bool HAVE_CR = false; |
bool HAVE_CR = false; |
38 |
void Log_OnFlush(object sender, LoggerOnFlushEventArgs e) |
void Log_OnFlush(object sender, LoggerOnFlushEventArgs e) |
39 |
{ |
{ |
40 |
|
|
41 |
log_flusher.Append(e.Buffer); |
log_flusher.Append(e.Buffer); |
42 |
if (IsUnix) |
if (IsUnix) |
43 |
{ |
{ |
48 |
} |
} |
49 |
} |
} |
50 |
else |
else |
51 |
{ |
{ |
52 |
if (e.Buffer == System.Environment.NewLine[0]) |
if (e.Buffer == System.Environment.NewLine[0]) |
53 |
{ |
{ |
54 |
HAVE_CR = true; |
HAVE_CR = true; |
60 |
HAVE_CR = false; |
HAVE_CR = false; |
61 |
} |
} |
62 |
} |
} |
63 |
|
|
64 |
} |
} |
65 |
//bool txtLog_EnterMouse = false; |
//bool txtLog_EnterMouse = false; |
66 |
|
|
75 |
void OnLogFlush(string logmessage) |
void OnLogFlush(string logmessage) |
76 |
{ |
{ |
77 |
if (this.IsDisposed) { return; } |
if (this.IsDisposed) { return; } |
78 |
Console.Write(logmessage); |
Console.Write(logmessage); |
79 |
txtStatus.Text = logmessage.Replace(System.Environment.NewLine, ""); |
txtStatus.Text = logmessage.Replace(System.Environment.NewLine, ""); |
80 |
txtLog.AppendText(logmessage); |
txtLog.AppendText(logmessage); |
81 |
|
|
97 |
} |
} |
98 |
private void main_Shown(object sender, EventArgs e) |
private void main_Shown(object sender, EventArgs e) |
99 |
{ |
{ |
100 |
|
|
101 |
} |
} |
102 |
|
|
103 |
|
|
133 |
} |
} |
134 |
|
|
135 |
private void mnuItemOpenXMLTVFile_Click(object sender, EventArgs e) |
private void mnuItemOpenXMLTVFile_Click(object sender, EventArgs e) |
136 |
{ |
{ |
137 |
//LoadXMLTVShcedule("20130307_continuum_schedule.xml"); |
try |
138 |
var result = xmltv_file_chooser.ShowDialog(); |
{ |
139 |
if (result != DialogResult.OK) return; |
//LoadXMLTVShcedule("20130307_continuum_schedule.xml"); |
140 |
ClearLocalLog(); |
var result = xmltv_file_chooser.ShowDialog(); |
141 |
LoadXMLTVShcedule(xmltv_file_chooser.FileName); |
if (result != DialogResult.OK) return; |
142 |
CreateControls(); |
ClearLocalLog(); |
143 |
|
LoadXMLTVShcedule(xmltv_file_chooser.FileName); |
144 |
|
CreateControls(); |
145 |
|
} |
146 |
|
catch (Exception ex) |
147 |
|
{ |
148 |
|
gLog.Log.Error.WriteLine(ex.ToString()); |
149 |
|
} |
150 |
} |
} |
151 |
|
|
152 |
private void mnuItemOpenSavedData_Click(object sender, EventArgs e) |
private void mnuItemOpenSavedData_Click(object sender, EventArgs e) |
153 |
{ |
{ |
154 |
var result = xmltv_program_data_loader.ShowDialog(); |
try |
|
if (result != DialogResult.OK) return; |
|
|
string filename = xmltv_program_data_loader.FileName; |
|
|
IXMLTVRuntimeInstance xmltv = null; |
|
|
bool status = false; |
|
|
xmltv = XMLTV.DeSerialize(filename, out status); |
|
|
if (!status) |
|
155 |
{ |
{ |
156 |
MessageBox.Show("Failed to load data - check log", "Failed to load data", MessageBoxButtons.OK, MessageBoxIcon.Error); |
var result = xmltv_program_data_loader.ShowDialog(); |
157 |
return; |
if (result != DialogResult.OK) return; |
158 |
|
string filename = xmltv_program_data_loader.FileName; |
159 |
|
IXMLTVRuntimeInstance xmltv = null; |
160 |
|
bool status = false; |
161 |
|
xmltv = XMLTV.DeSerialize(filename, out status); |
162 |
|
if (!status) |
163 |
|
{ |
164 |
|
MessageBox.Show("Failed to load data - check log", "Failed to load data", MessageBoxButtons.OK, MessageBoxIcon.Error); |
165 |
|
return; |
166 |
|
} |
167 |
|
MessageBox.Show("Successfully loaded data", "Successfully loaded data", MessageBoxButtons.OK, MessageBoxIcon.Information); |
168 |
|
CreateControls(); |
169 |
|
} |
170 |
|
catch (Exception ex) |
171 |
|
{ |
172 |
|
gLog.Log.Error.WriteLine(ex.ToString()); |
173 |
} |
} |
|
MessageBox.Show("Successfully loaded data", "Successfully loaded data", MessageBoxButtons.OK, MessageBoxIcon.Information); |
|
|
CreateControls(); |
|
174 |
} |
} |
175 |
|
|
176 |
private void mnuItemSaveData_Click(object sender, EventArgs e) |
private void mnuItemSaveData_Click(object sender, EventArgs e) |
177 |
{ |
{ |
178 |
var result = xmltv_program_data_saver.ShowDialog(); |
try |
179 |
if (result != DialogResult.OK) return; |
{ |
180 |
string filename = xmltv_program_data_saver.FileName; |
var result = xmltv_program_data_saver.ShowDialog(); |
181 |
if (!XMLTV.Serialize(filename)) |
if (result != DialogResult.OK) return; |
182 |
|
string filename = xmltv_program_data_saver.FileName; |
183 |
|
if (!XMLTV.Serialize(filename)) |
184 |
|
{ |
185 |
|
MessageBox.Show("Failed to save data - check log", "Failed to save data", MessageBoxButtons.OK, MessageBoxIcon.Error); |
186 |
|
return; |
187 |
|
} |
188 |
|
MessageBox.Show("Successfully saved data", "Successfully saved data", MessageBoxButtons.OK, MessageBoxIcon.Information); |
189 |
|
} |
190 |
|
catch (Exception ex) |
191 |
{ |
{ |
192 |
MessageBox.Show("Failed to save data - check log", "Failed to save data", MessageBoxButtons.OK, MessageBoxIcon.Error); |
gLog.Log.Error.WriteLine(ex.ToString()); |
|
return; |
|
193 |
} |
} |
|
MessageBox.Show("Successfully saved data", "Successfully saved data", MessageBoxButtons.OK, MessageBoxIcon.Information); |
|
194 |
} |
} |
195 |
|
|
196 |
private void main_FormClosing(object sender, FormClosingEventArgs e) |
private void main_FormClosing(object sender, FormClosingEventArgs e) |