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


C# Model.getWrappedModel方法代码示例

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


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

示例1: correct


//.........这里部分代码省略.........
                                setStringAttributeValue(element, attributeType, extensionPoints);

                                try
                                {
                                    model.adviseChange((new ElementWrapper(model, (EA.Element)element)));
                                    RuleService.active.Remove(getStringAttributeValue(element, "GUID"));
                                }
                                catch (Exception ex) { }

                                return true;
                            }
                        }
                    }

                    if (correctCall[i].StartsWith("setTransitionGuard"))
                    {
                        string nameExpression = correctCall[i].Split('(', ')')[1];

                        setStringAttributeValue(element, attributeType, nameExpression);

                        try
                        {
                            model.adviseChange(new ConnectorWrapper(model, (EA.Connector)element));
                        }
                        catch (Exception ex) { }
                    }

                    if (correctCall[i] == "createDecisionNode")
                    {
                        object owner = getConnectorOwner(element, model, "src");
                        object target = getConnectorOwner(element, model, "target");

                        EA.Collection collection = (EA.Collection)getAttributeValue(owner, "Connectors");
                        EA.Collection elements = model.getWrappedModel().GetPackageByID(Convert.ToInt32(getStringAttributeValue(owner, "PackageID"))).Elements;
                        EA.Collection connectors = model.getWrappedModel().GetPackageByID(Convert.ToInt32(getStringAttributeValue(owner, "PackageID"))).Connectors;

                        EA.Element decisionNode = (EA.Element)elements.AddNew("", "Decision");
                        decisionNode.Update();
                        elements.Refresh();

                        EA.Diagram diagram = model.getWrappedModel().GetCurrentDiagram();
                        EA.DiagramObject ownerDO = new Diagram(model, diagram).getdiagramObjectForElement(new ElementWrapper(model, (EA.Element)owner));

                        int l = ownerDO.left;
                        int b = ownerDO.bottom;
                        string coordinates = "l=" + (l + 20) + "r=" + (l + 60) + "t=" + (b - 50) + "b=" + (b - 90) + ";";

                        EA.DiagramObject displayElement = (EA.DiagramObject)diagram.DiagramObjects.AddNew(coordinates, "");

                        displayElement.ElementID = decisionNode.ElementID;
                        displayElement.Sequence = 1;
                        displayElement.Update();
                        diagram.DiagramObjects.Refresh();
                        diagram.Update();

                        EA.Connector connector = (EA.Connector)connectors.AddNew("", "ControlFlow");
                        connectors.Refresh();

                        connector.ClientID = Convert.ToInt32(getStringAttributeValue(owner, "ElementID"));
                        connector.SupplierID = decisionNode.ElementID;
                        connector.Update();

                        foreach (EA.Connector con in (EA.Collection)getAttributeValue(owner, "Connectors"))
                        {
                            if (con.ClientID == ((EA.Element)owner).ElementID)
                            {
开发者ID:JOndik,项目名称:SmallTEAmsHelper,代码行数:67,代码来源:Rule.cs

示例2: activate


//.........这里部分代码省略.........
                            {
                                return "";
                            }
                        }

                        int numControlFlows = Convert.ToInt32(validCall[i].Split('(', ')')[1]);
                        EA.Element connectorOwner = (EA.Element)getConnectorOwner(element, model, "src");
                        EA.Collection collection = (EA.Collection)getAttributeValue(connectorOwner, "Connectors");

                        int numOutgoing = 0;

                        foreach (EA.Connector con in collection)
                        {
                            if (con.ClientID == connectorOwner.ElementID)
                            {
                                numOutgoing++;
                            }
                        }

                        if (numControlFlows < numOutgoing)
                        {
                            return createDescription(element, getStringAttributeValue(getConnectorOwner(element, model, "src"), "Name"));
                        }
                        else
                        {
                            return "";
                        }
                    }

                    if (validCall[i] == "checkInitialNode")
                    {
                        bool rslt = false;

                        EA.Diagram diagram = model.getWrappedModel().GetCurrentDiagram();

                        foreach (EA.DiagramObject diagramObject in diagram.DiagramObjects)
                        {
                            EA.Element el = model.getWrappedModel().GetElementByID(diagramObject.ElementID);
                            if (el.Type == "StateNode" && el.Subtype == 100)
                            {
                                rslt = true;
                            }
                        }

                        if (!rslt)
                        {
                            return createDescription(element, getStringAttributeValue(diagram, "Name"));
                        }
                        else
                        {
                            return "";
                        }
                    }

                    if (validCall[i] == "checkFinalNode")
                    {
                        bool rslt = false;

                        EA.Diagram diagram = model.getWrappedModel().GetCurrentDiagram();

                        foreach (EA.DiagramObject diagramObject in diagram.DiagramObjects)
                        {
                            EA.Element el = model.getWrappedModel().GetElementByID(diagramObject.ElementID);
                            if (el.Type == "StateNode" && el.Subtype == 101)
                            {
                                rslt = true;
开发者ID:JOndik,项目名称:SmallTEAmsHelper,代码行数:67,代码来源:Rule.cs

示例3: findElementInCurDiagramtByName

        private EA.Element findElementInCurDiagramtByName(Model model, string targetName)
        {
            EA.Diagram diagram = model.getWrappedModel().GetCurrentDiagram();

            foreach (EA.DiagramObject diagObj in diagram.DiagramObjects)
            {
                EA.Element el = model.getWrappedModel().GetElementByID(diagObj.ElementID);
                if (el.Name == targetName)
                {
                    return el;
                }
            }

            return null;
        }
开发者ID:JOndik,项目名称:SmallTEAmsHelper,代码行数:15,代码来源:Rule.cs


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