예제 #1
0
        public App()
        {
            string logsFolder = Path.GetDirectoryName(Assembly.GetExecutingAssembly().GetName().CodeBase);
            Uri    uri        = new Uri(logsFolder);

            logsFolder = uri.LocalPath;
            logsFolder = Path.Combine(logsFolder, "logs");

            Log.SetLogFileDirectory(logsFolder);
            Log.SetLogFilename("Tess4Windows.txt");
            Log.SetLevel(Log.LEVEL.INFO);
            Log.Info("Tess4Windows - Start");

            DeleteOldLogs(logsFolder);

            this.DispatcherUnhandledException += HandleUnhandledExceptions;
            BindingExceptionThrower.Attach();

            try {
                tessBackground = aBasics.WpfBasics.Images.ImageSourceFromFile("Images\\tess_win_bg.jpg");
            }
            catch (Exception ex) {
                Log.Error("Load tessBackground", ex);
            }

            TessControlManager tcm = new TessControlManager();

            TessControlManager.Instance = tcm;
        }
예제 #2
0
 protected override void OnStartup(StartupEventArgs e)
 {
     base.OnStartup(e);
     if (Debugger.IsAttached)
     {
         BindingExceptionThrower.Attach();
     }
 }
예제 #3
0
        protected override void OnStartup(StartupEventArgs e)
        {
            base.OnStartup(e);

            // Start listening for WPF binding error.
            // After that line, a BindingException will be thrown each time
            // a binding error occurs
            BindingExceptionThrower.Attach();
        }
예제 #4
0
        public MainWindow()
        {
            //Silence freezable trace warnings since they don't seem to represent an actual problem
            PresentationTraceSources.FreezableSource.Switch.Level = SourceLevels.Error;
            BindingExceptionThrower.Attach();
            InitializeComponent();

            // Persist window position and size when opening and closing the application
            SourceInitialized += (sender, args) => Settings.StateTracker.Configure(this).IdentifyAs("WindowPosition").Apply();

            var mainWindowViewModel = (MainWindowViewModel)DataContext;

            var mappingsCollectionView = (ListCollectionView)CollectionViewSource.GetDefaultView(mainWindowViewModel.DisplayedMappings);

            mappingsCollectionView.SortDescriptions.Add(new SortDescription(nameof(DirectoryMapping.StringRepresentation), ListSortDirection.Ascending));

            ContentRendered += (sender, args) => {
                if (!Directory.Exists(Settings.AppDataDirectoryPath))
                {
                    mainWindowViewModel.NewUserSetup();
                }
            };
        }
예제 #5
0
        protected override void OnStartup(StartupEventArgs e)
        {
            base.OnStartup(e);

            BindingExceptionThrower.Attach();
        }
예제 #6
0
 private void Application_Startup(object sender, StartupEventArgs e)
 {
     BindingExceptionThrower.Attach();
 }