public XIOFile(String path) { this.FilePath = path.Replace("\r\n", ""); XmlDocument xDoc = new XmlDocument(); xDoc.Load(this.FilePath); XmlNodeList name = xDoc.GetElementsByTagName("name"); this.Name = name[0].InnerText + "(" + Path.GetFileName(this.FilePath) + ")"; this.TotalLength = XIOParser.getTotalLength(path); }
private void BtnMerge_Click(object sender, RoutedEventArgs e) { if (this.XIODatas == null || this.XIODatas.Count < 1) { MessageBox.Show("XIO Data가 없습니다."); return; } String result = XIOParser.merge(this.XIODatas.ToList()); this.tbXIO.Text = result; }
void tbPasteWorker_RunWorkerCompleted(object sender, RunWorkerCompletedEventArgs e) { if (this.tbXIO.Text.LastIndexOf("@@") >= this.tbXIO.Text.Length - 2 || this.tbXIO.Text.LastIndexOf(" ") >= this.tbXIO.Text.Length - 6) { byte[] xioByte = XIOParser.getByte(this.tbXIO.Text); if (XIOsAll.Where(x => x.TotalLength == xioByte.Length || (x.TotalLength == xioByte.Length - preIdx - postIdx)).Count() > 0) { XIOs.Clear(); XIOsAll.Where(x => x.TotalLength == xioByte.Length || (x.TotalLength == xioByte.Length - preIdx - postIdx)).ToList().ForEach(XIOs.Add); } } }
private void BtnXioParse_Click(object sender, RoutedEventArgs e) { if (this.lbXio.SelectedItem == null) { MessageBox.Show("XIO 전문을 선택해주세요"); return; } this.XIODatas.Clear(); XIOFile xIOFile = this.lbXio.SelectedItem as XIOFile; List <XIOData> xioDatas = XIOParser.parse(xIOFile.FilePath, this.tbXIO.Text); xioDatas.ToList().ForEach(this.XIODatas.Add); }