Ejemplo n.º 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();
        }
Ejemplo n.º 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;
 }
Ejemplo n.º 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.");
     }
 }
Ejemplo n.º 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
        }
Ejemplo n.º 5
0
        public void FocusComponent(Diagram diagram, Component component, bool activateDiagramTab = true)
        {
            Component diagramComponent = component;

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