private void OnTick(object sender, EventArgs e) { _logServices.TraceEnter(); try { _logServices.Trace("Checking if running on UI thread..."); if (_invoker.InvokeRequired) { _logServices.Trace("Not running on UI thread. Delegating to UI thread..."); _invoker.Invoke(new OnTickDelegate(OnTick), sender, e); return; } _logServices.Trace("Setting elapsed time..."); Elapsed = DateTime.Now - _startTime; } catch (Exception ex) { OnError(ex); } finally { _logServices.TraceExit(); } }
private void ProgressForm_Load(object sender, EventArgs e) { _logServices.TraceEnter(); try { _logServices.Trace("Creating view model..."); var invokerParameter = new ConstructorArgument("invoker", this); var viewModel = Services.Kernel.Get <ProgressFormViewModel>(invokerParameter); _logServices.Trace("Binding to form..."); bindingSourceForm.DataSource = viewModel; _logServices.Trace("Starting password testing..."); viewModel.Start(_windowHandle); } catch (Exception ex) { _logServices.Error(ex); MessageBox.Show(Properties.Resources.ERROR_MESSAGE_TEXT, Properties.Resources.ERROR_MESSAGE_CAPTION, MessageBoxButtons.OK, MessageBoxIcon.Error); } finally { _logServices.TraceExit(); } }
private void MainForm_Load(object sender, EventArgs e) { _logServices.TraceEnter(); try { // creating view model _logServices.Trace("Creating view model..."); var invokerParameter = new ConstructorArgument("invoker", this); var viewModel = Services.Kernel.Get <MainFormViewModel>(invokerParameter); _logServices.Trace("Assigning it to the data source..."); bindingSourceForm.DataSource = viewModel; } catch (Exception ex) { _logServices.Error(ex); MessageBox.Show(Properties.Resources.ERROR_MESSAGE_TEXT, Properties.Resources.ERROR_MESSAGE_CAPTION, MessageBoxButtons.OK, MessageBoxIcon.Error); } finally { _logServices.TraceExit(); } }