private void Window_Closing(object sender, System.ComponentModel.CancelEventArgs e) { _eventAggregator.Unsubscribe(this); Log log = new Log(); log.Text = "Program forceblly closed"; log.Type = LogType.ProgramClosed; LogsManager.GetLogsManager().AddLog(log); }
static async Task Main() { Log log = new Log(); log.Text = "Program forceblly closed"; log.Type = LogType.ProgramClosed; LogsManager.GetLogsManager().AddLog(log); await LogsManager.GetLogsManager().SyncLogs(); Console.WriteLine("Logged"); Console.WriteLine("ProgramClosed"); }
/// <summary> /// The Constructor /// </summary> public MainControlViewModel(IEventAggregator eventAggregator, User user) { _user = user; stateMngr = StateControllersManager.GetStateController(); logMngr = LogsManager.GetLogsManager(); filelMngr = FilesManager.GetFilesManager(); StartTime = startTime.ToString("HH:mm"); StopTime = endTime.ToString("HH:mm"); _eventAggregator = eventAggregator; _eventAggregator.Subscribe(this); appTimer = new Timer(1000); appTimer.Elapsed += AppTimer_Elapsed; appTimer.Start(); }