private void cmdTestService_Click(object sender, RoutedEventArgs e) { lblError.Text = ""; if (testinstance != null) { testinstance.Dispose(); } string err = ProtokollerConfiguration.ActualConfigInstance.CheckConfiguration(false); if (err != null) { lblError.Text = err; return; } try { testinstance = new ProtokollerInstance(ProtokollerConfiguration.ActualConfigInstance); testinstance.ThreadExceptionOccured += new ThreadExceptionEventHandler(testinstance_ThreadExceptionOccured); testinstance.Start(false); cmdTestService.Background = Brushes.LightGreen; cmdTest.IsEnabled = false; cmdTestTriggers.IsEnabled = false; cmdTestWithStorrage.IsEnabled = false; cmbTriggerConnection.IsEnabled = false; } catch (Exception ex) { lblError.Text = ex.Message; } }
protected override void OnStop() { myInstance.Dispose(); myInstance = null; }