Beispiel #1
0
        public MainWindow()
        {
            InitializeComponent();
            LoadingFile = false;

            var _newTabCmd = new RoutedCommand();

            _newTabCmd.InputGestures.Add(new KeyGesture(Key.N, ModifierKeys.Control));
            CommandBindings.Add(new CommandBinding(_newTabCmd, NewTabClick));

            var _stripCmd = new RoutedCommand();

            _stripCmd.InputGestures.Add(new KeyGesture(Key.F3));
            CommandBindings.Add(new CommandBinding(_stripCmd, StripClick));

            var _prepCmd = new RoutedCommand();

            _prepCmd.InputGestures.Add(new KeyGesture(Key.F2));
            CommandBindings.Add(new CommandBinding(_prepCmd, PrepareClick));

            var _clCmd = new RoutedCommand();

            _clCmd.InputGestures.Add(new KeyGesture(Key.L, ModifierKeys.Control));
            CommandBindings.Add(new CommandBinding(_clCmd, CopyLowerClick));

            var _cuCmd = new RoutedCommand();

            _cuCmd.InputGestures.Add(new KeyGesture(Key.U, ModifierKeys.Control));
            CommandBindings.Add(new CommandBinding(_cuCmd, CopyUpperClick));

            var _closeTcmd = new RoutedCommand();

            _closeTcmd.InputGestures.Add(new KeyGesture(Key.D, ModifierKeys.Control));
            CommandBindings.Add(new CommandBinding(_closeTcmd, CloseCurrentTabClick));

            var _pasteTcmd = new RoutedCommand();

            _pasteTcmd.InputGestures.Add(new KeyGesture(Key.V, ModifierKeys.Control));
            CommandBindings.Add(new CommandBinding(_pasteTcmd, PasteClick));

            Fingerprints = new List <Guid>();

            var _xml = new XmlDocumentHistory();

            _xml.RegenerateTab += _xml_RegenerateTab;

            if (_xml.HistoryTabCount > 0)
            {
                _xml.RecoverTabs();
            }
            else // Start empty session...
            {
                AddTab();
                CurrentEditor.InputFocus();
            }

            MnuDeleteHistory.IsEnabled = ProcessedTabs > 0 || XmlDocumentHistory.HistoryExists;

            // Scale to primary screen size to avoid oversize windows on that small-screen laptop I'm
            // using for work these days. --Will Kraft (3/22/2020).
            Width  = SystemParameters.PrimaryScreenWidth / 1.8;
            Height = SystemParameters.PrimaryScreenHeight / 1.4;
        }