コード例 #1
0
 private void OnLoadingDocument(DocumentLoadingEvent args)
 {
     IsBusy = true;
     try
     {
         _container.Resolve <ILogger>().Log(LogSeverity.Info, string.Format("Begin load document: {0}", args.Path), null);
         System.Threading.Thread.Sleep(TimeSpan.FromSeconds(1));
         IParsingService service = _container.Resolve <IParsingService>();
         Entries = new ObservableCollection <LogItem>(service.ParseLog(args.Path));
         _container.Resolve <IStateService>().AddToRecentAndSetCurrent(args.Path);
         _container.Resolve <ICommandManager>().Refresh();
     }
     catch (Exception ex)
     {
         _container.Resolve <ILogger>().Log(LogSeverity.Error, ex.Message, ex);
         MessageBox.Show(System.Windows.Application.Current.MainWindow, ex.Message, "Error", MessageBoxButton.OK, MessageBoxImage.Error);
     }
     finally
     {
         IsBusy = false;
     }
 }