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


C# EA.ReloadDiagram方法代码示例

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


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

示例1: CreateDefaultElementsForActivity

        public static bool ActivityIsSimple = true; // Create Activity from function in the simple form
        public static bool CreateDefaultElementsForActivity(EA.Repository rep, 
                                EA.Diagram dia, EA.Element act)
        {
            // create init node
            CreateInitFinalNode(rep, dia, act, 100, @"l=350;r=370;t=70;b=90;");
            act.Elements.Refresh();
            dia.DiagramObjects.Refresh();
            dia.Update();
            rep.ReloadDiagram(dia.DiagramID);

            return true;
        }
开发者ID:Helmut-Ortmann,项目名称:EnterpriseArchitect_hoTools,代码行数:13,代码来源:ActivityPar.cs

示例2: insertCDE

        public static void insertCDE(EA.Repository m_Repository, QueryServiceControl.QueryServiceManager.dataelement de, EAUtil.INSERT_XSD_TYPE xsdType)
        {
            try
            {
                string id = de.names.id;
                string name = de.names.preferred;
                string definition = QueryServiceControl.QueryServiceControl.getDefinition(de.definition);

                EA.Package package = m_Repository.GetPackageByID(m_Repository.GetCurrentDiagram().PackageID);
                EA.Element o = (EA.Element)package.Elements.AddNew(name.Replace(" ", "_"), "Class");
                o.Notes = definition + " (ID: " + id + ")";

                EAUtil.addTaggedValue("CDERef", id, o);
                EAUtil.addTaggedValue("preferred name", name, o);

                if (package.StereotypeEx == "XSDschema")
                {
                    if (xsdType == EAUtil.INSERT_XSD_TYPE.TOP_LEVEL_ELEMENT)
                    {
                        o.Stereotype = "XSDtopLevelElement";
                    }
                    else if (xsdType == EAUtil.INSERT_XSD_TYPE.TOP_LEVEL_ATTRIBUTE)
                    {
                        o.Stereotype = "XSDtopLevelAttribute";
                    }
                }

                if (de.values != null && de.values.Item is QueryServiceControl.QueryServiceManager.nonenumerated)
                {
                    string dataType = (de.values.Item as QueryServiceControl.QueryServiceManager.nonenumerated).datatype;
                    if (dataType.StartsWith("xs:"))// || dataType.StartsWith("xsd:"))
                    {
                        //o.Genlinks = "Parent=" + dataType.Substring(dataType.IndexOf(":") + 1) + ";";
                        string simpleTypeClassName = name.Replace(" ", "_") + "_Type";
                        EA.Element simpleTypeClass = (EA.Element)package.Elements.AddNew(simpleTypeClassName, "Class");
                        simpleTypeClass.Stereotype = "XSDsimpleType";
                        simpleTypeClass.Genlinks = "Parent=" + dataType.Substring(dataType.IndexOf(":") + 1) + ";";
                        simpleTypeClass.Update();
                        simpleTypeClass.Refresh();

                        EA.DiagramObject simpleTypeDiag = (EA.DiagramObject)(m_Repository.GetCurrentDiagram().DiagramObjects.AddNew("", ""));
                        simpleTypeDiag.ElementID = simpleTypeClass.ElementID;
                        simpleTypeDiag.Update();

                        EA.Connector simpleTypeConnector = (EA.Connector)o.Connectors.AddNew("", "Generalization");
                        simpleTypeConnector.SupplierID = simpleTypeDiag.ElementID;
                        simpleTypeConnector.Update();
                        o.Connectors.Refresh();
                    }
                    else
                    {
                        o.Genlinks = "Parent=" + dataType + ";";
                    }
                }
                else if (de.values != null && de.values.Item is QueryServiceControl.QueryServiceManager.enumerated)
                {
                    string enumClassName = "Enum_" + name.Replace(" ", "_");
                    EA.Element enumClass = (EA.Element)package.Elements.AddNew(enumClassName, "Class");
                    enumClass.Stereotype = "enumeration";
                    enumClass.Genlinks = "Parent=string;";

                    QueryServiceControl.QueryServiceManager.enumerated en =
                        de.values.Item as QueryServiceControl.QueryServiceManager.enumerated;

                    foreach (QueryServiceControl.QueryServiceManager.validvalue vv in en.validvalue)
                    {
                        EA.Attribute at = (EA.Attribute)enumClass.Attributes.AddNew("", "");
                        at.Stereotype = "enum";
                        at.Name = vv.code;
                        at.Notes = QueryServiceControl.QueryServiceControl.getMeaning(vv.meaning);
                        at.Update();
                    }
                    enumClass.Attributes.Refresh();

                    EA.DiagramObject enumDiag = (EA.DiagramObject)(m_Repository.GetCurrentDiagram().DiagramObjects.AddNew("", ""));
                    enumDiag.ElementID = enumClass.ElementID;
                    enumDiag.Update();

                    EA.Connector enumConnector = (EA.Connector)o.Connectors.AddNew("", "Generalization");
                    enumConnector.SupplierID = enumDiag.ElementID;
                    enumConnector.Update();
                    o.Connectors.Refresh();

                    enumClass.Update();
                    enumClass.Refresh();
                }
                //attr.Update();

                //o.Attributes.Refresh();

                o.Update();
                o.Refresh();

                EA.DiagramObject diagram = (EA.DiagramObject)(m_Repository.GetCurrentDiagram().DiagramObjects.AddNew("", ""));
                diagram.ElementID = o.ElementID;
                diagram.Update();

                m_Repository.ReloadDiagram(diagram.DiagramID);

                //this.Close();
//.........这里部分代码省略.........
开发者ID:NCIP,项目名称:cagrid-grid-incubation,代码行数:101,代码来源:EAUtil.cs

示例3: SetLineStyleDiagram

        //--------------------------------------------------------------------------------------------------------------
        // SetLineStyleDiagram  Set line style for a diagram (all visible 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       


        public static void SetLineStyleDiagram(EA.Repository rep, EA.Diagram d, string lineStyle)
        {
            // store current diagram
            rep.SaveDiagram(d.DiagramID);
            // all links
            foreach (EA.DiagramLink link in d.DiagramLinks)
            {
                if (link.IsHidden == false)
                {
                    SetLineStyleForDiagramLink(lineStyle, link);
                }

            }
            rep.ReloadDiagram(d.DiagramID);
        }
开发者ID:Helmut-Ortmann,项目名称:EnterpriseArchitect_hoTools,代码行数:30,代码来源:Util.cs

示例4: SetLineStyleDiagramObjectsAndConnectors

        //--------------------------------------------------------------------------------------------------------------
        // 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();
         }
开发者ID:Helmut-Ortmann,项目名称:EnterpriseArchitect_hoTools,代码行数:55,代码来源:Util.cs

示例5: CreateDefaultElementsForStateDiagram

        //------------------------------------------------------------------------------
        // Create default Elements for Statemachine
        //------------------------------------------------------------------------------
        //
        // init
        // state 'State1'
        // final
        // transition from init to 'State1'

        public static bool CreateDefaultElementsForStateDiagram(EA.Repository rep, EA.Diagram dia, EA.Element stateChart)
        {

            // check if init and final node are available
            bool init = false;
            bool final = false;
            foreach (EA.Element node in stateChart.Elements)
            {
                init |= node.Type == "StateNode" & node.Subtype == 100;
                final |= node.Type == "StateNode" & node.Subtype == 101;
            }
            EA.Element initNode = null;
            if (!init)
            {
                initNode = (EA.Element)stateChart.Elements.AddNew("", "StateNode");
                initNode.Subtype = 3;
                initNode.ParentID = stateChart.ElementID;
                initNode.Update();
                if (dia != null)
                {
                    Util.AddSequenceNumber(rep, dia);
                    var initDiaNode = (EA.DiagramObject)dia.DiagramObjects.AddNew("l=295;r=315;t=125;b=135;", "");
                    initDiaNode.Sequence = 1;
                    initDiaNode.ElementID = initNode.ElementID;
                    initDiaNode.Update();
                    Util.SetSequenceNumber(rep, dia, initDiaNode, "1");
                }

            }
            EA.Element finalNode = null;
            // create final node
            if (!final)
            {
                finalNode = (EA.Element)stateChart.Elements.AddNew("", "StateNode");
                finalNode.Subtype = 4;
                finalNode.ParentID = stateChart.ElementID;
                finalNode.Update();
                if (dia != null)
                {
                    Util.AddSequenceNumber(rep, dia);
                    var finalDiaNode = (EA.DiagramObject)dia.DiagramObjects.AddNew("l=285;r=305;t=745;b=765;", "");
                    finalDiaNode.Sequence = 1;
                    finalDiaNode.ElementID = finalNode.ElementID;
                    finalDiaNode.Update();
                    Util.SetSequenceNumber(rep, dia, finalDiaNode, "1");
                }
            }
            // create state node
            var stateNode = (EA.Element)stateChart.Elements.AddNew("", "State");
            stateNode.Subtype = 0;// state
            stateNode.Name = "State1";
            stateNode.ParentID = stateChart.ElementID;
            stateNode.Update();
            if (dia != null)
            {
                Util.AddSequenceNumber(rep, dia);
                string pos = "l=300;r=400;t=-400;b=-470";
                var stateDiaNode = (EA.DiagramObject)dia.DiagramObjects.AddNew(pos, "");
                stateDiaNode.Sequence = 1;
                stateDiaNode.ElementID = stateNode.ElementID;
                stateDiaNode.Update();
                Util.SetSequenceNumber(rep, dia, stateDiaNode, "1");

                // draw a transition
                var con = (EA.Connector)finalNode.Connectors.AddNew("", "StateFlow");
                con.SupplierID = stateNode.ElementID;
                con.ClientID = initNode.ElementID;
                con.Update();
                finalNode.Connectors.Refresh();
            }


            stateChart.Elements.Refresh();
            dia.DiagramObjects.Refresh();
            dia.Update();
            rep.ReloadDiagram(dia.DiagramID);

            return true;
        }
开发者ID:Helmut-Ortmann,项目名称:EnterpriseArchitect_hoTools,代码行数:88,代码来源:Appl.cs


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