private void listView_SelectedIndexChanged(object sender, EventArgs e) { try { if (listView.SelectedItems.Count != 0) { ListViewItem item = listView.SelectedItems[0]; FileInfo fi = (FileInfo)item.Tag; Logger.info(string.Format("대화함: 파일 선택됨[{0}]", fi.Name)); StreamReader sr = fi.OpenText(); DialogContent form = new DialogContent(); string dialogstr = ""; while (!sr.EndOfStream) { dialogstr += sr.ReadLine() + "\r\n"; } string title = item.SubItems[1].Text; form.setContentInfo(title, dialogstr); form.Show(this); item.Selected = false; sr.Close(); } } catch (Exception exception) { Logger.error(exception.ToString()); } }
private void DialoglistView_Click(object sender, EventArgs e) { try { ListView view = (ListView)sender; if (view.SelectedItems.Count != 0) { ListViewItem item = view.SelectedItems[0]; FileInfo fi = (FileInfo)item.Tag; logWrite(fi.Name); StreamReader sr = fi.OpenText(); DialogContent form = new DialogContent(); string dialogstr = ""; while (!sr.EndOfStream) { dialogstr += sr.ReadLine()+"\r\n"; } string title = item.SubItems[1].Text; form.setContentInfo(title, dialogstr); form.Show(mDialogListForm); item.Selected = false; sr.Close(); } } catch (Exception exception) { logWrite(exception.ToString()); } }
private void DialoglistView_Click(object sender, EventArgs e) { try { ListView view = (ListView)sender; if (view.SelectedItems.Count != 0) { ListViewItem item = view.SelectedItems[0]; FileInfo fi = (FileInfo)item.Tag; logWrite(fi.Name); StreamReader sr = fi.OpenText(); DialogContent form = new DialogContent(); while (!sr.EndOfStream) { string dialogstr = sr.ReadLine(); form.textBox.AppendText(dialogstr + "\r\n\r\n"); } form.Text = item.SubItems[1].Text; form.Show(dialoglistform); form.TopMost = true; item.Selected = false; sr.Close(); } } catch (Exception exception) { logWrite(exception.ToString()); } }