示例#1
0
文件: MyAddin.cs 项目: jotab/add_in
        //
        private void showProperties(EA.Repository repository)
        {
            outputTabActive(repository);
            repository.WriteOutput(OUTPUT_NAME, "Tags created:\n", 0);
            Diagram dia = repository.GetCurrentDiagram();
            for (short i = 0; i < dia.DiagramLinks.Count; i++)
            {
                DiagramLink diaLink = dia.DiagramLinks.GetAt(i);
                Connector con = repository.GetConnectorByID(diaLink.ConnectorID);

            }

            /*foreach (Package model in repository.Models)
             repository.WriteOutput(OUTPUT_NAME, "\n\nName of all Elements: ", 0);
                    foreach (Element element in package.Elements)
                    {
                        repository.WriteOutput(OUTPUT_NAME, element.Name, 0);
                    }
                }
            }*/
        }
示例#2
0
文件: MyAddin.cs 项目: jotab/add_in
 private void restoreClientElementApeearance(EA.Repository repository, EventProperties info)
 {
     EA.Connector connector = repository.GetConnectorByID(IDcollect(repository, info));
     Element client = repository.GetElementByID(connector.ClientID);
     Element supplier = repository.GetElementByID(connector.SupplierID);
     client.SetAppearance(1, 0, 0);
     client.Update();
 }
示例#3
0
 public void RunConnectorRule(EA.Repository Repository, string sRuleID, long lConnectorID)
 {
     EA.Connector Connector = Repository.GetConnectorByID((int)lConnectorID);
     if (Connector != null)
     {
         switch (LookupMapEx(sRuleID))
         {
             case rule07:
                 DoRule07(Repository, Connector);
                 break;
             case rule08:
                 DoRule08(Repository, Connector);
                 break;
             case rule09:
                 DoRule09(Repository, Connector);
                 break;
             case rule15:
                 DoRule15(Repository, Connector);
                 break;
             case rule16:
                 DoRule16(Repository, Connector);
                 break;
             case rule21:
                 DoRule21(Repository, Connector);
                 break;
             case rule22:
                 DoRule22(Repository, Connector);
                 break;
             case rule23:
                 DoRule23(Repository, Connector);
                 break;
             case rule25:
                 DoRule25(Repository, Connector);
                 break;
             case rule31:
                 DoRule31(Repository, Connector);
                 break;
             case rule35:
                 DoRule35(Repository, Connector);
                 break;
             case rule36:
                 DoRule36(Repository, Connector);
                 break;
             case rule37:
                 DoRule37(Repository, Connector);
                 break;
             case rule39:
                 DoRule39(Repository, Connector);
                 break;
             default:
                 break;
         }
     }
 }
示例#4
0
文件: MyAddin.cs 项目: jotab/add_in
 ///////////////////////////////////
 //                 ---------     END EA METHODS     ---------
 private void paintClient(EA.Repository repository, EA.EventProperties info)
 {
     Connector connector = repository.GetConnectorByID(IDcollect(repository, info));
     Element client = repository.GetElementByID(connector.ClientID);
     Element supplier = repository.GetElementByID(connector.SupplierID);
     client.SetAppearance(1, BORDER, RED);
     client.Update();
 }
        //--------------------------------------------------------------------------------------------------------------
        // SetLineStyleDiagramObjectsAndConnectors  Set line style for diagram objects and connectors
        //--------------------------------------------------------------------------------------------------------------
        // linestyle
        // LH = "Line Style: Lateral Horizontal";
        // LV = "Line Style: Lateral Vertical";
        // TH  = "Line Style: Tree Horizontal";
        // TV = "Line Style: Tree Vertical";
        // OS = "Line Style: Orthogonal Square";
        // OR =              Orthogonal Round
        // A =               Automatic
        // D =               Direct
        // C =               Customer 
        // B =               Bezier
        public static void SetLineStyleDiagramObjectsAndConnectors(EA.Repository rep, EA.Diagram d, string lineStyle)
         {
             EA.Collection selectedObjects = d.SelectedObjects;
             EA.Connector selectedConnector = d.SelectedConnector;
             // store current diagram
             rep.SaveDiagram(d.DiagramID);
             foreach (EA.DiagramLink link in d.DiagramLinks)
             {
                 if (link.IsHidden == false)
                 {

                     // check if connector is connected with diagram object
                     EA.Connector c = rep.GetConnectorByID(link.ConnectorID);
                     foreach (EA.DiagramObject dObject in d.SelectedObjects)
                     {
                         if (c.ClientID == dObject.ElementID | c.SupplierID == dObject.ElementID)
                         {

                             SetLineStyleForDiagramLink(lineStyle, link);
                         }
                     }
                     if (selectedConnector != null)
                     {
                         if (c.ConnectorID == selectedConnector.ConnectorID)
                         {
                             SetLineStyleForDiagramLink(lineStyle, link);
                             continue;
                         }
                     }
                 }
             }
             rep.ReloadDiagram(d.DiagramID);
             if (selectedConnector != null) d.SelectedConnector = selectedConnector;
             foreach (EA.DiagramObject dObject in selectedObjects)
             {
                 //d.SelectedObjects.AddNew(el.ElementID.ToString(), el.Type);
                 d.SelectedObjects.AddNew(dObject.ElementID.ToString(), dObject.ObjectType.ToString());
             }
             //d.Update();
             d.SelectedObjects.Refresh();
         }