예제 #1
0
        public static List <DataTemplateViewModel> GetDependencyDiagramTemplate(DependencyDiagramViewModel vm)
        {
            MetaModel metaModel = vm.DiagramClassView.DiagramView.ViewContext.ModelContext.MetaModel;

            return(ParseFile(vm.ViewModelStore, "DependencyDiagramTemplate.xml",
                             new string[] {
                metaModel.Name,                                 // CustomString0
                vm.DiagramClassView.DiagramClass.Name,          // CustomString1
                metaModel.Namespace,                            // CustomString2
            }));
        }
        /// <summary>
        /// Adds a new diagram class view model for the given node.
        /// </summary>
        /// <param name="node">Node.</param>
        public void AddDiagramClassView(DiagramClassView node)
        {
            // verify that node hasnt been added yet
            foreach (DiagramClassViewModel viewModel in this.rootNodeVMs)
                if (viewModel.DiagramClassView.Id == node.Id)
                    return;

            if (node.DiagramClass is SpecificDependencyDiagram)
            {
                SpecificDependencyDiagramViewModel vm = new SpecificDependencyDiagramViewModel(this.ViewModelStore, node, this);
                this.rootNodeVMs.Add(vm);
            }
            else if (node.DiagramClass is DependencyDiagram)
            {
                DependencyDiagramViewModel vm = new DependencyDiagramViewModel(this.ViewModelStore, node, this);
                this.rootNodeVMs.Add(vm);
            }
            else if (node.DiagramClass is ModalDiagram)
            {
                ModalDiagramViewModel vm = new ModalDiagramViewModel(this.ViewModelStore, node, this);
                this.rootNodeVMs.Add(vm);
            }
            else if (node.DiagramClass is SpecificElementsDiagram)
            {
                SpecificElementsDiagramViewModel vm = new SpecificElementsDiagramViewModel(this.ViewModelStore, node, this);
                this.rootNodeVMs.Add(vm);
            }
            else
            {
                DiagramClassViewModel vm = new DiagramClassViewModel(this.ViewModelStore, node, this);
                this.rootNodeVMs.Add(vm);
            }
        }
        public static List<DataTemplateViewModel> GetDependencyDiagramTemplate(DependencyDiagramViewModel vm)
        {
            MetaModel metaModel = vm.DiagramClassView.DiagramView.ViewContext.ModelContext.MetaModel;

            return ParseFile(vm.ViewModelStore, "DependencyDiagramTemplate.xml",
                new string[]{
                    metaModel.Name,                             // CustomString0
                    vm.DiagramClassView.DiagramClass.Name,      // CustomString1
                    metaModel.Namespace,                        // CustomString2
                });

        }