예제 #1
0
        private void BindProjectVersion(ProjectVersion projectVersion)
        {
            if (projectVersion.PIMDiagrams.Count == 0)
            {
                PIMDiagram pimDiagram = new PIMDiagram(projectVersion.Project);
                projectVersion.PIMDiagrams.Add(pimDiagram);
                pimDiagram.LoadSchemaToDiagram(projectVersion.PIMSchema);
            }

            if (projectVersion.PSMDiagrams.Count == 0)
            {
                foreach (PSMSchema psmSchema in projectVersion.PSMSchemas)
                {
                    PSMDiagram psmDiagram = new PSMDiagram(projectVersion.Project);
                    projectVersion.PSMDiagrams.Add(psmDiagram);
                    psmDiagram.LoadSchemaToDiagram(psmSchema);
                }
            }

            DiagramTabManager.BindToProjectVersion(projectVersion);
            if (DiagramTabManager.ActiveDiagram == null)
            {
                DiagramTabManager.OpenTabsForProjectVersion(Current.Project.LatestVersion);
            }
            //navigatorTab.PIMModelTreeView.BindToProjectVersion(projectVersion);

            RefreshMenu();
        }
예제 #2
0
 public void CurrentProjectChanged(object sender, CurrentProjectChangedEventArgs e)
 {
     CloseProject();
     if (e.NewProject != null)
     {
         BindProject(e.NewProject);
         if (e.NewProject.ProjectFile != null && e.NewProject.ProjectFile.Exists &&
             File.Exists(UserFileForProjectFile(e.NewProject.ProjectFile.FullName)))
         {
             LoadProjectLayout(UserFileForProjectFile(e.NewProject.ProjectFile.FullName));
         }
         else
         {
             if (Current.Project.LatestVersion.PIMDiagrams.Count > 0)
             {
                 DiagramTabManager.ActivateDiagram(Current.Project.LatestVersion.PIMDiagrams[0]);
             }
             if (Current.Project.LatestVersion != null)
             {
                 DiagramTabManager.OpenTabsForProjectVersion(Current.Project.LatestVersion);
             }
         }
     }
     Current.ExecutedCommand += ReportDisplay.ExecutedCommand;
 }
예제 #3
0
 public void FocusComponent(IEnumerable <PIMDiagram> pimDiagrams, PIMComponent component, bool activateDiagramTab = true)
 {
     if (pimDiagrams.Count() == 1)
     {
         DiagramTabManager.ActivateDiagramWithElement(pimDiagrams.First(), component, activateDiagramTab);
     }
     else
     {
         throw new NotImplementedException("Focus component not implemented for the case where the component is present in zero or more than one diagram.");
     }
 }
예제 #4
0
        public MainPage()
        {
            Current.MainWindow = this;
            GuiCommands.Init(this);
            InitializeComponent();
            InitializeRibbon();

            DiagramTabManager = new DiagramTabManager(this);


            this.Loaded += MainWindow_Loaded;
            //Current.ActiveDiagramChanged += Current_ActiveDiagramChanged;

            #if DEBUG
            #else
            ServerCommunication.ServerProjectListLoaded += ServerCommunication_ServerProjectListLoaded;
            ServerCommunication.GetServerProjects();
            #endif
        }
예제 #5
0
        public void FocusComponent(Diagram diagram, Component component, bool activateDiagramTab = true)
        {
            Component diagramComponent = component;

            DiagramTabManager.ActivateDiagramWithElement(diagram, diagramComponent, activateDiagramTab);
        }
예제 #6
0
 public void CloseProject()
 {
     UnBindProjectVersion(Current.ProjectVersion);
     UnBindProject(Current.Project);
     DiagramTabManager.CloseAllTabs();
 }
예제 #7
0
 private void UnBindProjectVersion(ProjectVersion unloadedProjectVersion)
 {
     DiagramTabManager.UnBindFromProjectVersion(unloadedProjectVersion);
     //navigatorTab.PIMModelTreeView.UnBindFromProjectVersion(unloadedProjectVersion);
     RefreshMenu();
 }