<commit_before>﻿using System;
using System.Windows;
using System.Windows.Threading;
using FlowGraphBase.Logger;

namespace FlowSimulator
{
    /// <summary>
    /// Interaction logic for App.xaml
    /// </summary>
    public partial class App : Application
    {
#if !DEBUG

        bool _ShowFatalError = true;

#endif //!DEBUG

        /// <summary>
        /// 
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void Application_DispatcherUnhandledException(object sender,
                       DispatcherUnhandledExceptionEventArgs e)
        {
            Exception ex = Helper.GetFirstException(e.Exception);

            LogManager.Instance.WriteException(ex);

#if DEBUG
            MessageBox.Show("Application_DispatcherUnhandledException() : " + ex.Message + Environment.NewLine + ex.StackTrace,
                "Exception Caught", MessageBoxButton.OK, MessageBoxImage.Error);
            e.Handled = true;
#else
            if (_ShowFatalError == true)
            {
                MessageBox.Show(
                    "Fatal error! The application is going to close! (see log)", 
                    "Uncaught Exception", 
                    MessageBoxButton.Ok, MessageBoxImage.Error);
                e.Handled = false;
                _ShowFatalError = false;<commit_msg>fix bug compil in release<commit_after>﻿using System;
using System.Windows;
using System.Windows.Threading;
using FlowGraphBase.Logger;

namespace FlowSimulator
{
    /// <summary>
    /// Interaction logic for App.xaml
    /// </summary>
    public partial class App : Application
    {
#if !DEBUG

        bool _ShowFatalError = true;

#endif //!DEBUG

        /// <summary>
        /// 
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void Application_DispatcherUnhandledException(object sender,
                       DispatcherUnhandledExceptionEventArgs e)
        {
            Exception ex = Helper.GetFirstException(e.Exception);

            LogManager.Instance.WriteException(ex);

#if DEBUG
            MessageBox.Show("Application_DispatcherUnhandledException() : " + ex.Message + Environment.NewLine + ex.StackTrace,
                "Exception Caught", MessageBoxButton.OK, MessageBoxImage.Error);
            e.Handled = true;
#else
            if (_ShowFatalError)
            {
                MessageBox.Show(
                    "Fatal error! The application is going to close! (see log)", 
                    "Uncaught Exception", 
                    MessageBoxButton.OK, MessageBoxImage.Error);
                e.Handled = false;
                _ShowFatalError = false;
{'fraction_non_alphanumeric': 0.10433504775900074, 'fraction_numerical': 0.0, 'mean_word_length': 1.9248120300751879, 'pattern_counts': {'":': 0, '<': 19, '<?xml version=': 0, '>': 19, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2610844', 'n_tokens_mistral': 716, 'n_tokens_neox': 670, 'n_words': 160}