Ejemplo n.º 1
0
        private void SetContextMenu()
        {
            MenuCreater creater = new MenuCreater();

            foreach (KeyValuePair <string, IView> viewKey in this._views)
            {
                PopupMenu menu = creater.CreateMenu(this.ObjectName,
                                                    viewKey.Value.ViewName,
                                                    this.ribbon,
                                                    this._commandManager);
                if (menu != null)
                {
                    this.ribbon.SetPopupContextMenu(viewKey.Value as Control, menu);
                }
            }
        }
Ejemplo n.º 2
0
        public void AddView(IView view)
        {
            Guard.ObjectIsInstanceOfType(view, typeof(Control), "view");
            _views.Add(view.ViewName, view);
            view.WorkSpaceID = this._wokspaceID;
            view.Context     = this._workspaceContext;
            MenuCreater creater = new MenuCreater();
            PopupMenu   menu    = creater.CreateMenu(this.ObjectName,
                                                     view.ViewName,
                                                     this.ribbon,
                                                     this._commandManager);

            if (menu != null)
            {
                //this.ribbon.SetPopupContextMenu(view as Control, menu);
                if (view is IObjectListView)
                {
                    ((IObjectListView)view).PopupMenu = menu;
                }
            }
        }