当前位置: 首页>>代码示例>>C#>>正文


C# EA.GetConnectorByGuid方法代码示例

本文整理汇总了C#中EA.GetConnectorByGuid方法的典型用法代码示例。如果您正苦于以下问题:C# EA.GetConnectorByGuid方法的具体用法?C# EA.GetConnectorByGuid怎么用?C# EA.GetConnectorByGuid使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在EA的用法示例。


在下文中一共展示了EA.GetConnectorByGuid方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: showObjectProperties

 public void showObjectProperties(EA.Repository Repository, string GUID, EA.ObjectType ot)
 {
     eaObjectType.Text = ot.ToString();
     eaObjectName.Text = "?";
     switch(ot)
     {
         case EA.ObjectType.otAttribute:
             EA.Attribute attribute = Repository.GetAttributeByGuid(GUID);
             currentEaObject = attribute;
             currentEaObjectCollections = null;
             eaObjectName.Text = attribute.Name;
             showEmbeddedObjects.Enabled = false;
             showEmbeddedObjects.Checked = false;
             break;
         case EA.ObjectType.otElement:
             EA.Element element = Repository.GetElementByGuid(GUID);
             currentEaObject = element;
             currentEaObjectCollections = new EAElementCollections(element);
             eaObjectName.Text = element.Name;
             showEmbeddedObjects.Enabled = true;
             break;
         case EA.ObjectType.otMethod:
             EA.Method method = Repository.GetMethodByGuid(GUID);
             currentEaObject = method;
             currentEaObjectCollections = null;
             eaObjectName.Text = method.Name;
             showEmbeddedObjects.Enabled = false;
             showEmbeddedObjects.Checked = false;
             break;
         case EA.ObjectType.otPackage:
             EA.Package package = Repository.GetPackageByGuid(GUID);
             currentEaObject = package;
             currentEaObjectCollections = new EAPackageCollections(package);
             eaObjectName.Text = package.Name;
             showEmbeddedObjects.Enabled = true;
             break;
         case EA.ObjectType.otConnector:
             EA.Connector connector = Repository.GetConnectorByGuid(GUID);
             currentEaObject = connector;
             currentEaObjectCollections = null;
             showEmbeddedObjects.Enabled = false;
             showEmbeddedObjects.Checked = false;
             break;
         default:
             currentEaObject = null;
             currentEaObjectCollections = null;
             propertyGrid.SelectedObject = null;
             showEmbeddedObjects.Enabled = false;
             showEmbeddedObjects.Checked = false;
             break;
     }
     SynchPropertyGridSelection();
 }
开发者ID:makulik,项目名称:EA-Explorer,代码行数:53,代码来源:EAExplorerControl.cs

示例2: deleteConnector

        /// <summary>
        /// method deletes connector
        /// </summary>
        /// <param name="Repository">EA repository</param>
        /// <param name="connectorGUID">GUID of connector that should be deleted</param>
        /// <param name="diagramGUID">GUID of diagram</param>
        /// <param name="elementType">type of connector that should be deleted</param>
        public void deleteConnector(EA.Repository Repository, string connectorGUID, string diagramGUID, int elementType)
        {
            EA.Connector connector = (EA.Connector)Repository.GetConnectorByGuid(connectorGUID);
            string name = connector.Name;
            EA.Element srcElement = (EA.Element)Repository.GetElementByID(connector.ClientID);
            EA.Element targetElement = (EA.Element)Repository.GetElementByID(connector.SupplierID);

            for (short i = 0; i < srcElement.Connectors.Count; i++)
            {
                EA.Connector conn = (EA.Connector)srcElement.Connectors.GetAt(i);
                if (conn.ConnectorGUID == connectorGUID)
                {
                    srcElement.Connectors.DeleteAt(i, false);
                    break;
                }
            }
            srcElement.Connectors.Refresh();

            BPAddIn.synchronizationWindow.addToList("Deletion of " + itemTypes.getElementTypeInEnglish(elementType) + " '"
                + name + "' between element '" + srcElement.Name +
                "' and element '" + targetElement.Name + "'");
        }
开发者ID:JOndik,项目名称:SmallTEAmsHelper,代码行数:29,代码来源:SynchronizationDeletions.cs

示例3: handleContextItemChange

        public void handleContextItemChange(EA.Repository repository, string GUID, ObjectType ot)
        {
            try
            {
                switch (ot)
                {
                    case ObjectType.otElement:
                        this.currentItem = repository.GetElementByGuid(GUID);

                        if (currentItem.Type == "Class")
                        {
                            currentAttributes = new Dictionary<string, EA.Attribute>();
                            foreach (EA.Attribute attr in currentItem.Attributes)
                            {
                                currentAttributes.Add(attr.AttributeGUID, attr);
                            }
                        }

                        if (currentItem.Type == "UseCase")
                        {
                            // CONSTRAINTS
                            currentConstraintsList = new List<ConstraintWrapper>();
                            foreach (EA.Constraint constraint in currentItem.Constraints)
                            {
                                currentConstraintsList.Add(new ConstraintWrapper(constraint));
                            }

                            // SCENARIOS
                            currentScenarioList = new List<ScenarioWrapper>();
                            currentScenarioStepList = new Dictionary<string, List<EA.ScenarioStep>>();
                            foreach (EA.Scenario scenario in currentItem.Scenarios)
                            {
                                currentScenarioList.Add(new ScenarioWrapper(scenario));
                                if (!currentScenarioStepList.ContainsKey(scenario.ScenarioGUID))
                                {
                                    currentScenarioStepList.Add(scenario.ScenarioGUID, new List<ScenarioStep>());
                                }

                                foreach (ScenarioStep step in scenario.Steps)
                                {
                                    currentScenarioStepList[scenario.ScenarioGUID].Add(step);
                                }
                            }
                        }

                        this.currentConnector = null;
                        this.currentDiagram = null;
                        changed = false;
                        currentAuthor = repository.GetElementByGuid(GUID).Author;
                        break;
                    case ObjectType.otPackage:
                        this.currentItem = repository.GetElementByGuid(GUID);
                        this.currentConnector = null;
                        this.currentDiagram = null;
                        changed = false;
                        currentAuthor = repository.GetElementByGuid(GUID).Author;
                        break;
                    case ObjectType.otConnector:
                        this.currentConnector = repository.GetConnectorByGuid(GUID);
                        this.currentItem = null;
                        this.currentDiagram = null;
                        changed = false;
                        break;
                    case ObjectType.otDiagram:
                        this.currentDiagram = (EA.Diagram)repository.GetDiagramByGuid(GUID);
                        this.currentConnector = null;
                        this.currentItem = null;
                        changed = false;
                        currentAuthor = ((EA.Diagram)repository.GetDiagramByGuid(GUID)).Author;
                        currentParent = currentDiagram.ParentID.ToString();

                        currentExtensionPoints = new Dictionary<string, string>();
                        currentDiagramObjectPositions = new Dictionary<int, string>();
                        foreach (EA.DiagramObject diagramObject in currentDiagram.DiagramObjects)
                        {
                            try
                            {
                                EA.Collection col = repository.GetElementSet("" + diagramObject.ElementID, 1);
                                EA.Element element = (EA.Element)col.GetAt(0);

                                if (element.Type == "UseCase")
                                {
                                    currentExtensionPoints.Add(element.ElementGUID, element.ExtensionPoints);
                                }
                            }
                            catch (Exception ex)
                            {
                            }

                            string coordinates = "";
                            coordinates += "l=" + diagramObject.left + ";";
                            coordinates += "r=" + diagramObject.right + ";";
                            coordinates += "t=" + diagramObject.top + ";";
                            coordinates += "b=" + diagramObject.bottom + ";";
                            currentDiagramObjectPositions.Add(diagramObject.ElementID, coordinates);

                        }
                        break;
                    default:
                        return;
//.........这里部分代码省略.........
开发者ID:JOndik,项目名称:SmallTEAmsHelper,代码行数:101,代码来源:ContextWrapper.cs

示例4: broadcastEvent

        public void broadcastEvent(Wrapper.Model model, EA.Repository Repository, string GUID, EA.ObjectType ot)
        {
            ping(GUID, Repository);

            if (ot == EA.ObjectType.otElement)
            {
                object element = Repository.GetElementByGuid(GUID);
                foreach (Rule registeredRule in eventWatchers[((EA.Element)element).Type])
                {
                    string rslt = registeredRule.activate(element, model);
                    if (rslt != "")
                    {
                        if (!active.ContainsKey(GUID))
                        {
                            RuleEntry ruleEntry = createRuleEntry(model, rslt, element, registeredRule);

                            if (active.ContainsKey(GUID))
                            {
                                active[GUID].Add(ruleEntry);
                            }
                            else
                            {
                                List<RuleEntry> ruleEntryList = new List<RuleEntry>();
                                ruleEntryList.Add(ruleEntry);
                                active.Add(GUID, ruleEntryList);
                            }

                            showErrorWindow(Repository);
                            addToDefectsList(rslt, ruleEntry);
                        }
                        else
                        {
                            foreach (RuleEntry ruleEntry in active[GUID])
                            {
                                if (ruleEntry.rule == registeredRule)
                                {
                                    addToDefectsList(rslt, ruleEntry);
                                }
                            }
                        }
                    }
                    else
                    {
                        if (active.ContainsKey(GUID))
                        {
                            RuleEntry ruleEntry = active[GUID].Find(x => x.rule == registeredRule);

                            if (ruleEntry != null)
                            {
                                BPAddIn.BPAddIn.defectsWindow.removeFromList(ruleEntry.listBoxObject);
                                BPAddIn.BPAddIn.defectsWindow.removeFromHiddenList(ruleEntry.listBoxObject);
                                active.Remove(GUID);
                            }
                        }
                    }
                }
            }
            else if (ot == EA.ObjectType.otConnector)
            {
                object connector = Repository.GetConnectorByGuid(GUID);
                foreach (Rule registeredRule in eventWatchers[((EA.Connector)connector).Type])
                {
                    string rslt = registeredRule.activate(connector, model);
                    if (rslt != "")
                    {
                        if (!active.ContainsKey(GUID) || active[GUID].Find(x => x.rule == registeredRule) == null)
                        {
                            RuleEntry ruleEntry = createRuleEntry(model, rslt, connector, registeredRule);

                            if (active.ContainsKey(GUID))
                            {
                                active[GUID].Add(ruleEntry);
                            }
                            else
                            {
                                List<RuleEntry> ruleEntryList = new List<RuleEntry>();
                                ruleEntryList.Add(ruleEntry);
                                active.Add(GUID, ruleEntryList);
                            }

                            showErrorWindow(Repository);
                            addToDefectsList(rslt, ruleEntry);
                        }
                        else
                        {
                            foreach (RuleEntry ruleEntry in active[GUID])
                            {
                                if (ruleEntry.rule == registeredRule)
                                {
                                    addToDefectsList(rslt, ruleEntry);
                                }
                            }
                        }
                    }
                    else
                    {
                        if (active.ContainsKey(GUID))
                        {
                            RuleEntry ruleEntry = active[GUID].Find(x => x.rule == registeredRule);

//.........这里部分代码省略.........
开发者ID:JOndik,项目名称:SmallTEAmsHelper,代码行数:101,代码来源:RuleService.cs

示例5: changeConnectorTargetCardinality

        /// <summary>
        /// method changes cardinality of connector at target element
        /// </summary>
        /// <param name="Repository">EA repository</param>
        /// <param name="connectorGUID">GUID of changed connector at target element</param>
        /// <param name="cardinality">new cardinality of changed connector at target element</param>
        /// <param name="oldCardinality">old cardinality of changed connector at target element</param>
        /// <param name="elementType">type of changed connector</param>
        public void changeConnectorTargetCardinality(EA.Repository Repository, string connectorGUID, string cardinality, string oldCardinality, int elementType)
        {
            EA.Connector connector = (EA.Connector)Repository.GetConnectorByGuid(connectorGUID);
            connector.SupplierEnd.Cardinality = cardinality;
            connector.Update();

            EA.Element srcElement = (EA.Element)Repository.GetElementByID(connector.ClientID);
            EA.Element targetElement = (EA.Element)Repository.GetElementByID(connector.SupplierID);

            BPAddIn.synchronizationWindow.addToList("Change of cardinality of " + itemTypes.getElementTypeInEnglish(elementType) + " '" +
               connector.Name + "' at target element - previous cardinality: '" + oldCardinality + "', current cardinality: '" + cardinality +
               "' (Connector between element '" + srcElement.Name + "' and element '" + targetElement.Name + "')");
        }
开发者ID:JOndik,项目名称:SmallTEAmsHelper,代码行数:21,代码来源:SynchronizationChanges.cs

示例6: changeConnectorTarget

        /// <summary>
        /// method changes target element of connector
        /// </summary>
        /// <param name="Repository">EA repository</param>
        /// <param name="connectorGUID">GUID of changed connector</param>
        /// <param name="targetGUID">GUID of new target element of changed connector</param>
        /// <param name="oldTargetGUID">GUID of previous target element of changed connector</param>
        /// <param name="elementType">type of changed connector</param>
        public void changeConnectorTarget(EA.Repository Repository, string connectorGUID, string targetGUID, string oldTargetGUID, int elementType)
        {
            EA.Element targetElement = (EA.Element)Repository.GetElementByGuid(targetGUID);
            EA.Element oldTargetElement = (EA.Element)Repository.GetElementByGuid(oldTargetGUID);

            EA.Connector connector = (EA.Connector)Repository.GetConnectorByGuid(connectorGUID);
            connector.SupplierID = targetElement.ElementID;
            connector.Update();

            EA.Element srcElement = (EA.Element)Repository.GetElementByID(connector.ClientID);

            BPAddIn.synchronizationWindow.addToList("Change of target element of " + itemTypes.getElementTypeInEnglish(elementType) + " '" +
               connector.Name + "' - previous target element: '" + oldTargetElement.Name + "', current target element: '" + targetElement.Name +
               "' (Connector between element '" + srcElement.Name + "' and element '" + targetElement.Name + "')");
        }
开发者ID:JOndik,项目名称:SmallTEAmsHelper,代码行数:23,代码来源:SynchronizationChanges.cs

示例7: changeConnectorNotes

        /// <summary>
        /// method changes notes of connector
        /// </summary>
        /// <param name="Repository">EA repository</param>
        /// <param name="connectorGUID">GUID of changed connector</param>
        /// <param name="notes">new notes of changed connector</param>
        /// <param name="elementType">type of changed connector</param>
        public void changeConnectorNotes(EA.Repository Repository, string connectorGUID, string notes, int elementType)
        {
            EA.Connector connector = (EA.Connector)Repository.GetConnectorByGuid(connectorGUID);
            connector.Notes = notes;
            connector.Update();

            EA.Element srcElement = (EA.Element)Repository.GetElementByID(connector.ClientID);
            EA.Element targetElement = (EA.Element)Repository.GetElementByID(connector.SupplierID);

            BPAddIn.synchronizationWindow.addToList("Change of notes of " + itemTypes.getElementTypeInEnglish(elementType) + " '" +
               connector.Name + "' (Connector between element '" + srcElement.Name + "' and element '" + targetElement.Name + "')");
        }
开发者ID:JOndik,项目名称:SmallTEAmsHelper,代码行数:19,代码来源:SynchronizationChanges.cs

示例8: changeConnectorGuard

        /// <summary>
        /// method changes guard of connector
        /// </summary>
        /// <param name="Repository">EA repository</param>
        /// <param name="connectorGUID">GUID of changed connector</param>
        /// <param name="guard">new guard of changed connector</param>
        /// <param name="oldGuard">previous guard of changed connector</param>
        /// <param name="elementType">type of changed connector</param>
        public void changeConnectorGuard(EA.Repository Repository, string connectorGUID, string guard, string oldGuard, int elementType)
        {
            EA.Connector connector = (EA.Connector)Repository.GetConnectorByGuid(connectorGUID);
            connector.TransitionGuard = guard;
            connector.Update();

            EA.Element srcElement = (EA.Element)Repository.GetElementByID(connector.ClientID);
            EA.Element targetElement = (EA.Element)Repository.GetElementByID(connector.SupplierID);

            BPAddIn.synchronizationWindow.addToList("Change of guard of " + itemTypes.getElementTypeInEnglish(elementType) + " '" +
               connector.Name + "' - previous guard: '" + oldGuard + "', current guard: '" + guard +
               "' (Connector between element '" + srcElement.Name + "' and element '" + targetElement.Name + "')");
        }
开发者ID:JOndik,项目名称:SmallTEAmsHelper,代码行数:21,代码来源:SynchronizationChanges.cs


注:本文中的EA.GetConnectorByGuid方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。