Beispiel #1
0
        public CrashForm(CrashReporter reporter)
        {
            Eto.Serialization.Xaml.XamlReader.Load(this);

            crash_fn              = reporter.ReportFn;
            infoTextBox.Text      = File.ReadAllText(crash_fn);
            infoTextBox.Selection = new Range <int>(0, 0);

            if (reporter.HasCurrentTtBackup)
            {
                fnLabel.Text = reporter.OrigTtFileName != "" ? reporter.OrigTtFileName : T._("<Neue Datei>");
            }
            restoreGroupBox.Visible = reporter.HasCurrentTtBackup;
            norestoreButton.Visible = !reporter.HasCurrentTtBackup;
        }
Beispiel #2
0
        public MainForm(LastFileHandler lfh, CrashReporting.CrashReporter crashReporter, Bootstrapper bootstrapper)
        {
            Eto.Serialization.Xaml.XamlReader.Load(this);
            Icon = new Icon(this.GetResource("Resources.programm.ico"));

            this.lfh      = lfh;
            Bootstrapper  = bootstrapper;
            CrashReporter = crashReporter;

            lfh.LastFilesUpdates += UpdateLastFilesMenu;
            UpdateLastFilesMenu(null, null);

            Bootstrapper.Logger.AttachLogger(logTextBox);
            Bootstrapper.InitializeUi(this);
            Bootstrapper.FileStateChanged += FileStateChanged;
            Bootstrapper.FileHandler.AsyncOperationStateChanged += FileHandlerOnAsyncOperationStateChanged;

            this.AddSizeStateHandler();
        }
Beispiel #3
0
        public MainForm()
        {
            Eto.Serialization.Xaml.XamlReader.Load(this);
            Icon = new Icon(this.GetResource("Resources.programm.ico"));

            timetableBackup = new Dictionary <object, Timetable>();

            Settings         = new Settings();
            undo             = new UndoManager();
            registry         = new RegisterStore();
            update           = new UpdateManager(Settings);
            extensionManager = new ExtensionManager(this, update);
            crashReporter    = new CrashReporting.CrashReporter(this);
            fileHandler      = new FileHandler(this, this, this, undo);

            lineEditingControl.Initialize(this);

            var logger = new MultipleLogger(logTextBox);

            if (Settings.Get("log.enable-file", false))
            {
                logger.Loggers.Add(new TempLogger(this));
            }
            if (OptionsParser.MPCompatLog)
            {
                logger.Loggers.Add(new ConsoleLogger());
            }
            Logger = logger;

            KeyDown += (s, e) =>
            {
                if (e.Key == Keys.R || e.Key == Keys.Escape)
                {
                    lineEditingControl.DispatchKeystroke(e);
                }
            };

            fileHandler.FileStateChanged += FileHandler_FileStateChanged;
            fileHandler.FileOpened       += FileHandler_FileOpened;

            Init();
        }