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


C# EA.WriteOutput方法代码示例

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


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

示例1: UpdateActionPinParameter

        //---------------------------------------------------------------------------------------------
        // updateActionParameter(EA.Repository rep, EA.Element actionPin)
        //---------------------------------------------------------------------------------------------
        public static bool UpdateActionPinParameter(EA.Repository rep, EA.Element action)
        {
            foreach (EA.Element actionPin in action.EmbeddedElements)
            {
                // pin target for the return type of the action
                if (actionPin.Name == "target")
                {
                    //// return type
                    //Int32 parTypeID = Util.getTypeID(rep, m.ReturnType);
                    //if (parTypeID != 0)
                    //{
                    //    //pin.Name = par.
                    //    pin.ClassfierID = parTypeID;
                    //    EA.Element el = rep.GetElementByID(parTypeID);
                    //    pin.Update(); // do it before update table
                    //    Util.setElementPDATA1(rep, pin, el.ElementGUID);// set PDATA1

                    //}
                }
                else
                {
                    // get type of synchronized parameter
                    // if parameter isn't synchronized it will not work
                    string type = Util.GetParameterType(rep, actionPin.ElementGUID);
                    if (type == "")
                    {
                        string txt = "No type is available for action:'" + action.Name + "'";
                        rep.WriteOutput("ifm_addin", txt, 0);
                    }
                    else
                    {
                        Int32 parTypeId = Util.GetTypeId(rep, type);
                        if (parTypeId != 0)
                        {
                            //pin.Name = par.
                            EA.Element el = rep.GetElementByID(parTypeId);
                            Util.SetElementPdata1(rep, actionPin, el.ElementGUID);// PDATA1 setzen
                        }
                    }
                }
            }

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

示例2: showProperties

        //
        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);
                    }
                }
            }*/
        }
开发者ID:jotab,项目名称:add_in,代码行数:22,代码来源:MyAddin.cs

示例3: GetLatest

        public static bool GetLatest(EA.Repository rep, EA.Package pkg, bool recursive, ref int count, int level, ref int errorCount)
        {
            if (pkg.IsControlled)
            {
                level = level + 1;
                // check if checked out

                string path = GetVccFilePath(rep, pkg);
                string fText;
                //rep.WriteOutput("Debug", "Path:" + pkg.Name + path, 0);
                var sLevel = new string(' ', level * 2);
                rep.WriteOutput("Debug", sLevel + (count+1).ToString(",0") + " Work for:" + path, 0);
                if (path != "")
                {
                    count = count + 1;
                    rep.ShowInProjectView(pkg);
                    // delete a potential write protection
                    try
                    {
                        var fileInfo = new FileInfo(path);
                        var attributes = (FileAttributes)(fileInfo.Attributes - FileAttributes.ReadOnly);
                        System.IO.File.SetAttributes(fileInfo.FullName, attributes);
                        System.IO.File.Delete(path);
                    }
                    catch (FileNotFoundException e)
                    {
                        fText = path + " " + e.Message;
                        rep.WriteOutput("Debug", fText, 0);
                        errorCount = errorCount + 1;
                    }
                    catch (DirectoryNotFoundException e)
                    {
                        fText = path + " " + e.Message;
                        rep.WriteOutput("Debug", fText, 0);
                        errorCount = errorCount + 1;
                    }
                    // get latest
                    try
                    {
                        // to make sure pkg is the correct reference
                        // new load of pkg after GetLatest
                        string pkgGuid = pkg.PackageGUID;
                        pkg.VersionControlGetLatest(true);
                        pkg = rep.GetPackageByGuid(pkgGuid);
                        count = count + 1;
                    }
                    catch
                    {
                        fText = path + " " + pkg.GetLastError();
                        rep.WriteOutput("Debug", fText, 0);
                        errorCount = errorCount + 1;
                    }

                }
                else
                {
                    fText = pkg.XMLPath + " invalid path";
                    rep.WriteOutput("Debug", fText, 0);
                    errorCount = errorCount + 1;

                }
            }

            //rep.WriteOutput("Debug", "Recursive:" +recursive.ToString(), 0);
            if (recursive)
            {
                //rep.WriteOutput("Debug","Recursive count:" + pkg.Packages.Count.ToString(), 0);
                // over all contained packages
                foreach (EA.Package pkgNested in pkg.Packages)
                {
                    //rep.WriteOutput("Debug", "Recursive:"+ pkgNested.Name, 0);
                    GetLatest(rep, pkgNested, true, ref count, level, ref errorCount);

                }
            }
            return true;

        }
开发者ID:Helmut-Ortmann,项目名称:EnterpriseArchitect_hoTools,代码行数:78,代码来源:Util.cs

示例4: EA_MenuClick

        // Called when user makes a selection in the menu.
        // This is your main exit point to the rest of your Add-in
        public void EA_MenuClick(EA.Repository Repository, string Location, string MenuName, string ItemName)
        {
            switch( ItemName )
            {
                case "&Audio Configuration":

                    String writerString;

                    writerString = "Please select an audio diagram";

                    Repository.CreateOutputTab("Audio Configuration");
                    Repository.EnsureOutputVisible("Audio Configuration");
                    Repository.ClearOutput("Audio Configuration");

                    /* works on currently selected diagram */

                    if (Repository.GetTreeSelectedItemType() == EA.ObjectType.otDiagram)
                    {
                        EA.Diagram theDiagram;

                        theDiagram = (EA.Diagram)Repository.GetTreeSelectedObject();
                        writerString = "Name = " + theDiagram.Name.ToString() + " " + theDiagram.Type.ToString() + System.Environment.NewLine;
                        Repository.WriteOutput("Audio Configuration", writerString, 0);

                        foreach (EA.DiagramObject theDiagramObject in theDiagram.DiagramObjects)
                        {
                            EA.Element theElement = Repository.GetElementByID(theDiagramObject.ElementID);

                            /* consider only instances */
                            if (theElement.ClassfierID != 0)
                            {
                                // get classifier, in our case it is sink or source classes
                                EA.Element theClassfierElement = Repository.GetElementByID(theElement.ClassfierID);

                                writerString = theElement.Name.ToString() + " " + theClassfierElement.Name.ToString();
                                //writerString = theDiagramObject.ObjectType.ToString() + System.Environment.NewLine;
                                Repository.WriteOutput("Audio Configuration", writerString, 0);

                                writerString = theElement.RunState;
                                Repository.WriteOutput("Audio Configuration", writerString, 0);

                                // parse embedded elements
                                foreach (EA.Element theEmbeddedElement in theElement.EmbeddedElements)
                                {
                                    writerString = "\t" + theEmbeddedElement.Name.ToString();
                                    Repository.WriteOutput("Audio Configuration", writerString, 0);
                                    foreach (EA.Connector theConnector in theEmbeddedElement.Connectors)
                                    {
                                        writerString = "\t\t" + theConnector.Name.ToString();
                                        Repository.WriteOutput("Audio Configuration", writerString, 0);
                                    }
                                }
                            }
                        }
                    }

                    break;
                case "&Menu2":

                    break;
                case "About...":
                    Form1 anAbout = new Form1();
                    anAbout.ShowDialog();
                    break;
            }
        }
开发者ID:razr,项目名称:ea-audio,代码行数:68,代码来源:Main.cs

示例5: GetVccRootPath

        public static string GetVccRootPath(EA.Repository rep, EA.Package pkg)
        {
            string rootPath = "";
            var pattern = new Regex(@"VCCFG=[^;]+");
            Match regMatch = pattern.Match(pkg.Flags);
            if (regMatch.Success)
            {
                // get VCCFG
                var uniqueId = regMatch.Value.Substring(6);
                // get path for UiqueId
                Environment.CurrentDirectory = Environment.GetEnvironmentVariable(@"appdata");
                string s1 = @"Sparx Systems\EA\paths.txt";
                TextReader tr = new StreamReader(s1);
                string line = "";
                pattern = new Regex(@"(id=" + uniqueId + @").+(path=[^;]+)");
                while ((line = tr.ReadLine()) != null)
                {

                    regMatch = pattern.Match(line);
                    if (regMatch.Success)
                    {
                        rootPath = regMatch.Groups[2].Value;
                        rootPath = rootPath.Substring(5);
                        break;
                    }
                }
                tr.Close();
                if (rootPath == "")
                {
                    rep.WriteOutput("Debug", "VCCFG=... not found in" + s1 + " " + pkg.Name, 0);
                }
                return rootPath;
            }            
            else
            {
                rep.WriteOutput("Debug", "VCCFG=... not found:" + pkg.Name, 0);
                return "";
            }

        }
开发者ID:Helmut-Ortmann,项目名称:EnterpriseArchitect_hoTools,代码行数:40,代码来源:Util.cs


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