Esempio n. 1
0
        public void RightClickNode()
        {
            IMenuRegistry registry = _menuController
                                     .GetMenuFor(typeof(TreeNode));

            _view.ShowContextMenu(registry);
        }
        public ProjectExplorerPresenter(IProjectExplorerView view, IMenuController menuController)
            : base(view)
        {
            _menuController = menuController;
            _view = view;
            view.SetPresenter(this);

            IMenuRegistry toolBar = _menuController.GetMenuFor(typeof (IProjectExplorerPresenter));

            view.SetToolbar(toolBar);
        }
Esempio n. 3
0
        public ProjectExplorerPresenter(IProjectExplorerView view, IMenuController menuController)
            : base(view)
        {
            _menuController = menuController;
            _view           = view;
            view.SetPresenter(this);

            IMenuRegistry toolBar = _menuController.GetMenuFor(typeof(IProjectExplorerPresenter));

            view.SetToolbar(toolBar);
        }
        private void HandleContextMenuAttributes(object instance, ICommand command)
        {
            foreach (ContextMenuAttribute contextAttribute in Reflector.GetAttributes <ContextMenuAttribute>(instance))
            {
                if (contextAttribute.TargetType == null)
                {
                    throw Error.ContextMenuAttributeMustHaveTargetTypeAssigned(instance.GetType());
                }

                _menuController
                .GetMenuFor(contextAttribute.TargetType)
                .AddCommand(command, contextAttribute);
            }
        }