1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253 |
- using System;
- using System.Collections.Generic;
- using System.ComponentModel;
- using System.Data;
- using System.Drawing;
- using System.IO;
- using System.Linq;
- using System.Text;
- using System.Windows.Forms;
- namespace LYFZ.Software.MainBusiness.MultipleFileImport
- {
- public partial class frmMultipleFileLogs : LYFZ.ComponentLibrary.BaseContentsFormMain
- {
- public frmMultipleFileLogs()
- {
- InitializeComponent();
- this.lb_LogList.MouseDoubleClick += new System.Windows.Forms.MouseEventHandler(this.lb_LogList_MouseDoubleClick);
- }
- public void LoadFileList(string[] fileList)
- {
- foreach(string str in fileList)
- {
- lb_LogList.Items.Add(new ItemObj() {
- Name= System.IO.Path.GetFileName(str),
- AllPath= str
- } );
- }
- }
- private void lb_LogList_MouseDoubleClick(object sender, MouseEventArgs e)
- {
- if(lb_LogList.SelectedIndex !=-1)
- {
- ItemObj itemObj = lb_LogList.SelectedItem as ItemObj;
- frmMultipFileLogMessage frmLogMessage = new frmMultipFileLogMessage();
- frmLogMessage.tb_LogMessage.Text = File.ReadAllText(itemObj.AllPath);
- frmLogMessage.ShowDialog();
- }
- }
- }
- class ItemObj
- {
- public string AllPath { get; set; }
- public string Name { get; set; }
- public override string ToString()
- {
- return Name;
- }
- }
- }
|