diff --git a/BPASmartClient.Helper/logHelper.cs b/BPASmartClient.Helper/logHelper.cs index 8938429f..60291612 100644 --- a/BPASmartClient.Helper/logHelper.cs +++ b/BPASmartClient.Helper/logHelper.cs @@ -31,8 +31,8 @@ namespace BPASmartClient.Helper /// 日志显示委托 /// public Action InfoNotify { get; set; } - private ILog directLogger = null; - private log4net.Appender.RollingFileAppender directRollfileAppender = null; + public ILog directLogger = null; + public log4net.Appender.RollingFileAppender directRollfileAppender = null; ILoggerRepository logRepos = null; private static bool m_isInitDirectLog = false; //是否初始化了直接写入日志文件 private static Int32 directFileSize = 50; diff --git a/BPASmartClient.ViewModel/LogViewModel.cs b/BPASmartClient.ViewModel/LogViewModel.cs index 77cff3f5..bb6522ff 100644 --- a/BPASmartClient.ViewModel/LogViewModel.cs +++ b/BPASmartClient.ViewModel/LogViewModel.cs @@ -100,6 +100,18 @@ namespace BPASmartClient.ViewModel ExcellOrder(); }); + OpenCommand = new RelayCommand(() => + { + string msg = string.Format("已找到日志文件,是否打开! \n 1.如选中不打开,则弹出日志文件夹目录。\n 2.打开,则弹出日志文件夹目录,并打开文件。"); + if (System.Windows.MessageBox.Show(msg, "提示", MessageBoxButton.OKCancel) == MessageBoxResult.OK) + { + System.Diagnostics.Process.Start("Explorer", "/select," + logHelper.GetLogConfigInstance().directRollfileAppender.File); + OpenFile(logHelper.GetLogConfigInstance().directRollfileAppender.File); + }else + System.Diagnostics.Process.Start("Explorer", "/select," + logHelper.GetLogConfigInstance().directRollfileAppender.File); + + }); + dispatcherTimer = new DispatcherTimer(); dispatcherTimer.Tick += delegate { @@ -246,7 +258,7 @@ namespace BPASmartClient.ViewModel } public RelayCommand ExcelCommand { get; set; } - + public RelayCommand OpenCommand { get; set; } } public class LogModel : ObservableObject diff --git a/BPASmartClient/Control/LogView.xaml b/BPASmartClient/Control/LogView.xaml index 0f50aa06..886b0319 100644 --- a/BPASmartClient/Control/LogView.xaml +++ b/BPASmartClient/Control/LogView.xaml @@ -28,6 +28,7 @@ +