@@ -31,8 +31,8 @@ namespace BPASmartClient.Helper | |||||
/// 日志显示委托 | /// 日志显示委托 | ||||
/// </summary> | /// </summary> | ||||
public Action<string> InfoNotify { get; set; } | public Action<string> 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; | ILoggerRepository logRepos = null; | ||||
private static bool m_isInitDirectLog = false; //是否初始化了直接写入日志文件 | private static bool m_isInitDirectLog = false; //是否初始化了直接写入日志文件 | ||||
private static Int32 directFileSize = 50; | private static Int32 directFileSize = 50; | ||||
@@ -100,6 +100,18 @@ namespace BPASmartClient.ViewModel | |||||
ExcellOrder(); | 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 = new DispatcherTimer(); | ||||
dispatcherTimer.Tick += delegate | dispatcherTimer.Tick += delegate | ||||
{ | { | ||||
@@ -246,7 +258,7 @@ namespace BPASmartClient.ViewModel | |||||
} | } | ||||
public RelayCommand ExcelCommand { get; set; } | public RelayCommand ExcelCommand { get; set; } | ||||
public RelayCommand OpenCommand { get; set; } | |||||
} | } | ||||
public class LogModel : ObservableObject | public class LogModel : ObservableObject | ||||
@@ -28,6 +28,7 @@ | |||||
<!--<CheckBox Margin="10,0,0,0" IsChecked="{Binding RealTimeModel, UpdateSourceTrigger=PropertyChanged}" >实时模式</CheckBox> | <!--<CheckBox Margin="10,0,0,0" IsChecked="{Binding RealTimeModel, UpdateSourceTrigger=PropertyChanged}" >实时模式</CheckBox> | ||||
<CheckBox Margin="10,0,0,0" IsChecked="{Binding TimedClear, UpdateSourceTrigger=PropertyChanged}">定时清除</CheckBox>--> | <CheckBox Margin="10,0,0,0" IsChecked="{Binding TimedClear, UpdateSourceTrigger=PropertyChanged}">定时清除</CheckBox>--> | ||||
<Button Margin="10,0,0,0" Cursor="Hand" Command="{Binding ExcelCommand}">导出日志</Button> | <Button Margin="10,0,0,0" Cursor="Hand" Command="{Binding ExcelCommand}">导出日志</Button> | ||||
<Button Margin="10,0,0,0" Cursor="Hand" Command="{Binding OpenCommand}">打开文件</Button> | |||||
</StackPanel> | </StackPanel> | ||||
<!--表格栏--> | <!--表格栏--> | ||||