Exemplo n.º 1
0
        public MesCommandMenuItem(MesCommand command, MesStandardMenuItem parent)
        {
            _command    = command;
            _keyGesture = Mvx.IoCProvider.Resolve <IMesCommandKeyGestureService>().GetPrimaryKeyGesture(_command.CommandDefinition);
            _parent     = parent;

            _listItems = new List <MesStandardMenuItem>();
        }
        public MesCommandToolBarItem(MesToolBarItemDefinition toolBarItem, MesCommand command, IMesToolBar parent)
        {
            _toolBarItem = toolBarItem;
            _command     = command;
            _keyGesture  = Mvx.IoCProvider.Resolve <IMesCommandKeyGestureService>().GetPrimaryKeyGesture(_command.CommandDefinition);
            _parent      = parent;

            command.PropertyChanged += OnCommandPropertyChanged;
        }
Exemplo n.º 3
0
        public MesTargetableCommand GetTargetableCommand(MesCommand command)
        {
            MesTargetableCommand targetableCommand;

            if (!_targetableCommands.TryGetValue(command, out targetableCommand))
            {
                targetableCommand = _targetableCommands[command] = new MesTargetableCommand(command);
            }
            return(targetableCommand);
        }
Exemplo n.º 4
0
        public MesCommand GetCommand(MesCommandDefinitionBase commandDefinition)
        {
            MesCommand command;

            if (!_commands.TryGetValue(commandDefinition, out command))
            {
                command = _commands[commandDefinition] = new MesCommand(commandDefinition);
            }
            return(command);
        }
        public override Task Run(MesCommand command)
        {
            Window window = Application.Current.MainWindow;

            if (window == null)
            {
                return(MesTaskUtility.Completed);
            }

            window.WindowState = window.WindowState != WindowState.Maximized ? WindowState.Maximized : WindowState.Normal;
            return(MesTaskUtility.Completed);
        }
        public override async Task Run(MesCommand command)
        {
            OpenFileDialog dialog = new OpenFileDialog
            {
                Filter = "All Supported Files|" + String.Join(";", _editorProviders
                                                              .SelectMany(x => x.FileTypes).Select(x => "*" + x.FileExtension))
            };

            dialog.Filter += "|" + String.Join("|", _editorProviders
                                               .SelectMany(x => x.FileTypes)
                                               .Select(x => x.Name + "|*" + x.FileExtension));

            if (dialog.ShowDialog() == true)
            {
                _shell.OpenDocument(await GetEditor(dialog.FileName));
            }
        }
Exemplo n.º 7
0
 public MesTargetableCommand(MesCommand command)
 {
     _command       = command;
     _commandRouter = Mvx.IoCProvider.Resolve <IMesCommandRouter>();
 }