Beispiel #1
0
        /// <summary>
        /// Opens the view model for the ModalDiagramTemplate.
        /// </summary>
        /// <param name="treeVM">Tree vm executing this command.</param>
        public virtual void OpenModalDiagramTemplate(DslEditorTreeViewModel::ModelElementTreeViewModel treeVM)
        {
            VSPluginDSLModalDiagramTemplateSurfaceViewModel vm = new VSPluginDSLModalDiagramTemplateSurfaceViewModel(treeVM.ViewModelStore, treeVM.Element as DslEditorModeling::DomainModelElement);

            DslEditorViewModelEvents::OpenViewModelEventArgs args = new DslEditorViewModelEvents::OpenViewModelEventArgs(vm);

            args.DockingPaneStyle = Tum.PDE.ToolFramework.Modeling.Visualization.ViewModel.DockingPaneStyle.DockedInDocumentPane;
            treeVM.EventManager.GetEvent <DslEditorViewModelEvents::OpenViewModelEvent>().Publish(args);
        }
Beispiel #2
0
        /// <summary>
        /// Modify the context menu view model by adding custom menu items.
        /// </summary>
        /// <param name="contextMenu">Context menu view model containing automatically added menu items.</param>
        /// <param name="element">Host element.</param>
        public override void ProcessContextMenu(DslEditorMenuModel::MenuItemViewModel contextMenu, DslEditorTreeViewModel::ModelElementTreeViewModel element, System.Collections.Generic.List <DslEditorViewModelContracts::IModelTreeContextMenuProvider> processedProviders)
        {
            base.ProcessContextMenu(contextMenu, element, processedProviders);

            if (element.Element is global::Tum.PDE.VSPluginDSL.DomainClass2)
            {
                DslEditorMenuModel::MenuItemViewModel openModalVMs = this.FindMenuViewModel(contextMenu, "OpenModalViewsFromModelTreeId");
                if (openModalVMs == null)
                {
                    openModalVMs          = new DslEditorMenuModel::MenuItemViewModel(contextMenu.ViewModelStore);
                    openModalVMs.Text     = "Open";
                    openModalVMs.UserData = "OpenModalViewsFromModelTreeId";

                    contextMenu.Children.Insert(0, openModalVMs);
                    contextMenu.Children.Insert(1, new DslEditorMenuModel::SeparatorMenuItemViewModel(contextMenu.ViewModelStore));
                }

                if (element.Element is global::Tum.PDE.VSPluginDSL.DomainClass2)
                {
                    DslEditorMenuModel::MenuItemViewModel <DslEditorTreeViewModel::ModelElementTreeViewModel> openVM = new DslEditorMenuModel::MenuItemViewModel <DslEditorTreeViewModel::ModelElementTreeViewModel>(contextMenu.ViewModelStore);
                    openVM.Text             = "Open " + "Modal View";
                    openVM.Command          = new DslEditorCommands::DelegateCommand <DslEditorTreeViewModel::ModelElementTreeViewModel>(OpenModalDiagramTemplate);
                    openVM.CommandParameter = element;

                    openModalVMs.Children.Add(openVM);
                }
            }
        }
Beispiel #3
0
 public ModelTreeVSPluginDSLViewModel(DslEditorViewModelData::ViewModelStore viewModelStore, DslModeling::ModelElement element, DslModeling::ElementLink link, System.Guid domainRoleId, DslEditorTreeViewModel::ModelElementTreeViewModel parent, bool bHookUpEvents, bool bCreateContextMenus, DslEditorViewModel::MainModelTreeViewModel mainModelTreeVm)
     : base(viewModelStore, element, link, domainRoleId, parent, bHookUpEvents, bCreateContextMenus, mainModelTreeVm)
 {
 }