Пример #1
0
 private void NewPart()
 {
     if (_engine.SupportedPartTypes.Length > 0)
     {
         TypeOfContentDialog.ShowHandlerDialog(_engine.SupportedPartTypes, false, true);
     }
 }
        public MainWindow()
        {
            this._filenameIndex = 0;
            this._packageName   = "";

            InitializeComponent();

            TypeOfContentDialog.AddNewPart += TypeOfContentDialog_AddNewPart;
            TypeOfContentDialog.SetParent(TypeOfContentDialogParent);

            this.Closing += Window_Closing;

            // Add keyboard shortcuts
            {
                var undoCmd = new System.Windows.Input.RoutedCommand();
                var undoGst = new System.Windows.Input.KeyGesture(System.Windows.Input.Key.Z,
                                                                  System.Windows.Input.ModifierKeys.Control);

                var redoCmd  = new System.Windows.Input.RoutedCommand();
                var redoGstZ = new System.Windows.Input.KeyGesture(System.Windows.Input.Key.Z,
                                                                   System.Windows.Input.ModifierKeys.Control | System.Windows.Input.ModifierKeys.Shift);
                var redoGstY = new System.Windows.Input.KeyGesture(System.Windows.Input.Key.Y,
                                                                   System.Windows.Input.ModifierKeys.Control);

                undoCmd.InputGestures.Add(undoGst);
                redoCmd.InputGestures.Add(redoGstZ);
                redoCmd.InputGestures.Add(redoGstY);

                CommandBindings.Add(new System.Windows.Input.CommandBinding(undoCmd, (e, s) => { _editor?.Undo(); }));
                CommandBindings.Add(new System.Windows.Input.CommandBinding(redoCmd, (e, s) => { _editor?.Redo(); }));
            }
        }
Пример #3
0
 private void NewFile()
 {
     if (_engine.SupportedPartTypes.Length > 0)
     {
         bool cancelable = _editor.Part != null;
         TypeOfContentDialog.ShowHandlerDialog(_engine.SupportedPartTypes, true, cancelable);
     }
 }
Пример #4
0
        public MainWindow()
        {
            this._filenameIndex = 0;
            this._packageName   = "";

            InitializeComponent();

            TypeOfContentDialog.AddNewPart += TypeOfContentDialog_AddNewPart;
            TypeOfContentDialog.SetParent(TypeOfContentDialogParent);

            this.Closing += Window_Closing;
        }