public void logOutputHandler(object sendingProcess, DataReceivedEventArgs outLine, iosSyslogger form, string uuid) //Log output hander { string currentPath = System.Environment.CurrentDirectory; bool exit = false; if (exit == true) { return; } try { form.BeginInvoke(new Action(() => { if (uuidToName.ContainsKey(uuid) == false) { return; } form.insertToDataSource(outLine.Data, uuidToName[uuid]); })); using (System.IO.StreamWriter file = new System.IO.StreamWriter(currentPath + @"\syslog" + uuid + ".txt", true)) { file.WriteLine(outLine.Data); } } catch { return; } //*Most of the logic for outputing the log should be dealt from this output Handler }
//Log output hander public void logOutputHandler(object sendingProcess, DataReceivedEventArgs outLine, iosSyslogger form, string uuid) { string currentPath = System.Environment.CurrentDirectory; bool exit = false; if (exit == true) return; try { form.BeginInvoke(new Action(() => { if (uuidToName.ContainsKey(uuid)==false) return; form.insertToDataSource(outLine.Data,uuidToName[uuid]); })); using (System.IO.StreamWriter file = new System.IO.StreamWriter(currentPath + @"\syslog" + uuid + ".txt", true)) { file.WriteLine(outLine.Data); } } catch { return ; } //*Most of the logic for outputing the log should be dealt from this output Handler }
private void deviceInfoHandler(object sendingProcess, DataReceivedEventArgs outLine, iosSyslogger form, string uuid) { form.BeginInvoke(new Action(() => { if (outLine.Data == null) { return; } if (outLine.Data.Contains("DeviceName:")) { string[] words = outLine.Data.Split(' '); words = words.Where(w => w != words[0]).ToArray(); string deviceName = ""; for (int i = 0; i < words.Length; i++) { if (i < words.Length - 1) { deviceName += words[i] + "-"; } else { deviceName += words[i]; } } try { uuidToName.Add(uuid, deviceName); } catch (Exception) { return; } } form.insertDeviceName = outLine.Data; })); }
private void deviceInfoHandler(object sendingProcess, DataReceivedEventArgs outLine, iosSyslogger form,string uuid) { form.BeginInvoke(new Action(() => { if(outLine.Data==null) return; if (outLine.Data.Contains("DeviceName:")) { string[] words = outLine.Data.Split(' '); words = words.Where(w => w != words[0]).ToArray(); string deviceName = ""; for (int i = 0; i < words.Length; i++) { if (i < words.Length - 1) deviceName += words[i] + "-"; else deviceName += words[i]; } try { uuidToName.Add(uuid, deviceName); } catch (Exception) { return; } } form.insertDeviceName = outLine.Data; })); }