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


C# EA.RefreshModelView方法代码示例

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


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

示例1: DeleteGenModels

        private void DeleteGenModels(EA.Repository Repository)
        {
            DialogResult dialogResult = MessageBox.Show(
                "Are you sure you want to delete the contents of «InteractionSpace View» and «NavigationSpace View»?",
                "XIS-Web Plugin", MessageBoxButtons.YesNo, MessageBoxIcon.Warning);

            if (dialogResult == DialogResult.Yes)
            {
                EA.Package rootPackage = Repository.Models.GetAt(0).Packages.GetAt(0);
                EA.Package navigationView = null;
                EA.Package interactionView = null;

                foreach (EA.Package package in rootPackage.Packages)
                {
                    if (package.StereotypeEx == "InteractionSpace View")
                    {
                        interactionView = package;
                    }
                    else if (package.StereotypeEx == "NavigationSpace View")
                    {
                        navigationView = package;
                    }
                }

                if (interactionView != null)
                {
                    if (interactionView.Diagrams.Count > 0)
                    {
                        EA.Collection diagrams = interactionView.Diagrams;

                        for (short i = 0; i < diagrams.Count; i++)
                        {
                            interactionView.Diagrams.Delete(i);
                        }
                    }

                    if (interactionView.Elements.Count > 0)
                    {
                        EA.Collection elements = interactionView.Elements;

                        for (short i = 0; i < elements.Count; i++)
                        {
                            interactionView.Elements.Delete(i);
                        }
                    }

                    Repository.RefreshModelView(interactionView.PackageID);
                }

                if (navigationView != null)
                {
                    if (navigationView.Diagrams.Count > 0)
                    {
                        EA.Collection diagrams = navigationView.Diagrams;

                        for (short i = 0; i < diagrams.Count; i++)
                        {
                            navigationView.Diagrams.Delete(i);
                        }
                    }

                    if (navigationView.Elements.Count > 0)
                    {
                        EA.Collection elements = navigationView.Elements;

                        for (short i = 0; i < elements.Count; i++)
                        {
                            navigationView.Elements.Delete(i);
                        }
                    }

                    Repository.RefreshModelView(navigationView.PackageID);
                }
            }
        }
开发者ID:theedward,项目名称:xisweb,代码行数:75,代码来源:CodeGenerator.cs

示例2: UpdateActionPinForPackage

        //----------------------------------------------------------------------------
        // updateActionPinForPackage(EA.Repository rep, EA.Package pkg)
        //----------------------------------------------------------------------------

        public static bool UpdateActionPinForPackage(EA.Repository rep, EA.Package pkg)
        {
            foreach (EA.Element el in pkg.Elements)
            {   // update parameter
                if (el.Type == "Action")
                {
                    UpdateActionPinParameter(rep, el);
                    rep.RefreshModelView(pkg.PackageID); // reload package
                }
                if (el.Type == "Activity")
                {
                    foreach (EA.Element elSub in el.Elements)
                    {
                        UpdateActionPinForElement(rep, elSub);
                    }
                }
            }
            foreach (EA.Package pkgSub in pkg.Packages)
            {
                // update all packages
                UpdateActionPinForPackage(rep, pkgSub);
            }
            return true;

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

示例3: newinfo

        public void newinfo(EA.Repository Repository)
        {
            Form7 form = new Form7();
            form.ShowDialog();

            if (form.confirm == 1)
            {
                this.encours = false;

                int packageid = 0;
                int packinfoid = 0;

                EA.Package pack0 = Repository.Models.GetAt(0);
                foreach (EA.Package package in pack0.Packages)
                {
                    foreach (EA.Package pack in package.Packages)
                    {
                        packageid = pack.PackageID;
                    }
                }
                pack0 = Repository.GetPackageByID(packageid);

                foreach (EA.Package packinfo in pack0.Packages)
                {
                    if (packinfo.Name == "Informations exchanged")
                        packinfoid = packinfo.PackageID;
                }
                if (packinfoid == 0)
                {
                    EA.Collection collec = pack0.Packages;
                    EA.Package packinfo = collec.AddNew("Informations exchanged", "Package");

                    packinfo.Update();
                    collec.Refresh();
                    pack0.Update();
                    packinfoid = packinfo.PackageID;
                }

                EA.Collection newinfo = Repository.GetPackageByID(packinfoid).Elements;
                EA.Element info = newinfo.AddNew(form.ID.Text, "Class");
                EA.Collection newinfoattributes = info.Attributes;

                EA.Attribute att = newinfoattributes.AddNew("id", "char");
                att.Default = form.ID.Text;
                att.Pos = 1;
                att.Update();

                att = newinfoattributes.AddNew("name", "char");
                att.Default = form.Name.Text;
                att.Pos = 2;
                att.Update();

                att = newinfoattributes.AddNew("description", "char");
                att.Default = form.Description.Text;
                att.Pos = 3;
                att.Update();

                newinfoattributes.Refresh();
                info.Update();
                newinfo.Refresh();

                Repository.RefreshModelView(packinfoid);
            }

            this.encours = true;

        }
开发者ID:jzarca01,项目名称:ZamiGen_addin,代码行数:67,代码来源:Class1.cs

示例4: executeSynchronization

        /// <summary>
        /// method executes synchronization process
        /// </summary>
        /// <param name="repository">EA repository</param>
        public void executeSynchronization(EA.Repository repository)
        {
            User user = getLoggedUser();
            using (WebClient webClient = new WebClient())
            {
                this.user = user;
                string result = "", result2 = "", result3 = "";
                ModelInformation synchronizationData = new ModelInformation();
                synchronizationData.token = user.token;
                EA.Package package = (EA.Package)repository.GetPackageByID(1);
                synchronizationData.modelGUID = package.PackageGUID;
                string data = user.token;

                BPAddIn.changesAllowed = false;
                webClient.Headers[HttpRequestHeader.ContentType] = "application/json; charset=utf-8";
                result = webClient.UploadString(Utils.serviceAddress + "/synchronization/getNumber", user.token);
                int number = Convert.ToInt32(result);
                if (BPAddIn.synchronizationWindow == null)
                {
                    BPAddIn.synchronizationWindow = repository.AddWindow("Synchronization", "BPAddIn.SynchronizationPackage.SynchronizationWindow") as SynchronizationWindow;
                }
                repository.ShowAddinWindow("Synchronization");
                BPAddIn.synchronizationWindow.removeList();

                DateTime localDate = DateTime.Now;
                var culture = new CultureInfo("de-DE");
                BPAddIn.synchronizationWindow.addToList(localDate.ToString(culture));

                if (number == 0)
                {
                    BPAddIn.synchronizationWindow.addToList("No modifications.");
                    BPAddIn.changesAllowed = true;
                    return;
                }

                while (true)
                {
                    try
                    {
                        data = user.token;
                        webClient.Headers[HttpRequestHeader.ContentType] = "application/json; charset=utf-8";
                        result2 = webClient.UploadString(Utils.serviceAddress + "/synchronization/changes", data);

                        ModelChange modelChange = JsonConvert.DeserializeObject<ModelChange>(result2, new JsonItemConverter());
                        if (modelChange == null)
                        {
                            data = user.token;
                            continue;
                        }
                        if (modelChange is PropertyChange)
                        {
                            PropertyChange propertyChange = (PropertyChange)modelChange;
                            if (propertyChange.timestamp == "-1")
                            {
                                repository.ShowAddinWindow("Synchronization");
                                repository.RefreshModelView(1);
                                break;
                            }
                        }

                        if (modelChange is ItemCreation)
                        {
                            ItemCreation itemCreation = (ItemCreation)modelChange;                                  //addition

                            NewCorrespondenceNode newCorrNode = new NewCorrespondenceNode();
                            newCorrNode.firstUsername = user.username;
                            newCorrNode.firstItemGUID = synchronization.handleSynchronizationAdditions(itemCreation, repository);
                            newCorrNode.secondUsername = itemCreation.userName;
                            newCorrNode.secondItemGUID = itemCreation.itemGUID;

                            data = EncodeNonAsciiCharacters(newCorrNode.serialize());
                            webClient.Headers[HttpRequestHeader.ContentType] = "application/json; charset=utf-8";
                            result3 = webClient.UploadString(Utils.serviceAddress + "/corrModel/createNode", data);
                        }
                        else if (modelChange is PropertyChange)
                        {
                            PropertyChange propertyChange = (PropertyChange)modelChange;
                            if (propertyChange.elementDeleted == 0)
                            {
                                synchronization.handleSynchronizationChanges(propertyChange, repository);       //change
                            }
                            else
                            {
                                synchronization.handleSynchronizationDeletions(propertyChange, repository);             //deletion
                            }
                        }
                        else if (modelChange is StepChange)                    //scenarios
                        {
                            StepChange scenarioChange = (StepChange)modelChange;

                            if (scenarioChange.status == 1)                            //addition
                            {
                                NewCorrespondenceNode newCorrNode = new NewCorrespondenceNode();
                                newCorrNode.firstUsername = user.username;
                                newCorrNode.firstItemGUID = synchronization.handleScenarioAddition(scenarioChange, repository);
                                newCorrNode.secondUsername = scenarioChange.userName;
//.........这里部分代码省略.........
开发者ID:JOndik,项目名称:SmallTEAmsHelper,代码行数:101,代码来源:SynchronizationService.cs

示例5: newreference

        public void newreference(EA.Repository Repository)
        {
            Form8 form = new Form8();
            form.ShowDialog();

            if (form.confirm == 1)
            {
                this.encours = false;

                int packageid = 0;
                int packreferenceid = 0;

                EA.Package pack0 = Repository.Models.GetAt(0);
                foreach (EA.Package package in pack0.Packages)
                {
                    foreach (EA.Package pack in package.Packages)
                    {
                        packageid = pack.PackageID;
                    }
                }
                pack0 = Repository.GetPackageByID(packageid);

                foreach (EA.Package packreference in pack0.Packages)
                {
                    if (packreference.Name == "References")
                        packreferenceid = packreference.PackageID;
                }
                if (packreferenceid == 0)
                {
                    EA.Collection collec = pack0.Packages;
                    EA.Package packreference = collec.AddNew("References", "Package");

                    packreference.Update();
                    collec.Refresh();
                    pack0.Update();
                    packreferenceid = packreference.PackageID;
                }

                EA.Collection newreference = Repository.GetPackageByID(packreferenceid).Elements;
                EA.Element reference = newreference.AddNew("Reference_" + form.No.Text, "Class");
                EA.Collection newreferenceattributes = reference.Attributes;

                EA.Attribute att = newreferenceattributes.AddNew("no", "char");
                att.Default = form.No.Text;
                att.Pos = 1;
                att.Update();

                att = newreferenceattributes.AddNew("type", "char");
                att.Default = form.Type.Text;
                att.Pos = 2;
                att.Update();

                att = newreferenceattributes.AddNew("reference", "char");
                att.Default = form.Reference.Text;
                att.Pos = 3;
                att.Update();

                att = newreferenceattributes.AddNew("status", "char");
                att.Default = form.Status.Text;
                att.Pos = 4;
                att.Update();

                att = newreferenceattributes.AddNew("impact", "char");
                att.Default = form.Impact.Text;
                att.Pos = 5;
                att.Update();

                att = newreferenceattributes.AddNew("originator", "char");
                att.Default = form.Originator.Text;
                att.Pos = 6;
                att.Update();

                att = newreferenceattributes.AddNew("link", "char");
                att.Default = form.Link.Text;
                att.Pos = 7;
                att.Update();

                newreferenceattributes.Refresh();
                reference.Update();
                newreference.Refresh();

                Repository.RefreshModelView(packreferenceid);

            }

            this.encours = true;

        }
开发者ID:jzarca01,项目名称:ZamiGen_addin,代码行数:88,代码来源:Class1.cs

示例6: newcustominfo

        public void newcustominfo(EA.Repository Repository)
        {
            Form6 form = new Form6();
            form.ShowDialog();

            if (form.confirm == 1)
            {
                this.encours = false;

                int packageid = 0;
                int packcustomid = 0;

                EA.Package pack0 = Repository.Models.GetAt(0);
                foreach (EA.Package package in pack0.Packages)
                {
                    foreach (EA.Package pack in package.Packages)
                    {
                        packageid = pack.PackageID;
                    }
                }
                pack0 = Repository.GetPackageByID(packageid);

                foreach (EA.Package packcustom in pack0.Packages)
                {
                    if (packcustom.Name == "Custom Informations")
                        packcustomid = packcustom.PackageID;
                }
                if (packcustomid == 0)
                {
                    EA.Collection collec = pack0.Packages;
                    EA.Package packcustom = collec.AddNew("Custom Informations", "Package");

                    packcustom.Update();
                    collec.Refresh();
                    pack0.Update();
                    packcustomid = packcustom.PackageID;
                }

                EA.Collection newcustom = Repository.GetPackageByID(packcustomid).Elements;
                EA.Element custom = newcustom.AddNew(form.Key.Text, "Class");
                EA.Collection newcustomattributes = custom.Attributes;

                EA.Attribute att = newcustomattributes.AddNew("key", "char");
                att.Default = form.Key.Text;
                att.Pos = 1;
                att.Update();

                att = newcustomattributes.AddNew("value", "char");
                att.Default = form.Value.Text;
                att.Pos = 2;
                att.Update();

                att = newcustomattributes.AddNew("refers", "char");
                att.Default = form.Refers.Text;
                att.Pos = 3;
                att.Update();

                newcustomattributes.Refresh();
                custom.Update();
                newcustom.Refresh();

                Repository.RefreshModelView(packcustomid);

            }

            this.encours = true;

        }
开发者ID:jzarca01,项目名称:ZamiGen_addin,代码行数:68,代码来源:Class1.cs

示例7: newKPI

        public void newKPI(EA.Repository Repository)
        {
            Form5 form = new Form5();
            form.ShowDialog();

            if (form.confirm == 1)
            {
                this.encours = false;

                int packageid = 0;
                int packkpiid = 0;

                EA.Package pack0 = Repository.Models.GetAt(0);
                foreach (EA.Package package in pack0.Packages)
                {
                    foreach (EA.Package pack in package.Packages)
                    {
                        packageid = pack.PackageID;
                    }
                }
                pack0 = Repository.GetPackageByID(packageid);

                foreach (EA.Package packkpi in pack0.Packages)
                {
                    if (packkpi.Name == "KPI")
                        packkpiid = packkpi.PackageID;
                }
                if (packkpiid == 0)
                {
                    EA.Collection collec = pack0.Packages;
                    EA.Package packkpi = collec.AddNew("KPI", "Package");

                    packkpi.Update();
                    collec.Refresh();
                    pack0.Update();
                    packkpiid = packkpi.PackageID;
                }

                EA.Collection newkpi = Repository.GetPackageByID(packkpiid).Elements;
                EA.Element kpi = newkpi.AddNew("KPI_" + form.ID.Text, "Class");
                EA.Collection newkpiattributes = kpi.Attributes;

                EA.Attribute att = newkpiattributes.AddNew("id", "char");
                att.Default = form.ID.Text;
                att.Pos = 1;
                att.Update();

                att = newkpiattributes.AddNew("name", "char");
                att.Default = form.Name.Text;
                att.Pos = 2;
                att.Update();

                att = newkpiattributes.AddNew("description", "char");
                att.Default = form.Description.Text;
                att.Pos = 3;
                att.Update();

                att = newkpiattributes.AddNew("reference", "char");
                att.Default = form.Reference.Text;
                att.Pos = 4;
                att.Update();

                newkpiattributes.Refresh();
                kpi.Update();
                newkpi.Refresh();

                Repository.RefreshModelView(packkpiid);

            }

            this.encours = true;

        }
开发者ID:jzarca01,项目名称:ZamiGen_addin,代码行数:73,代码来源:Class1.cs

示例8: newterm

        public void newterm(EA.Repository Repository)
        {
            Form4 form = new Form4();
            form.ShowDialog();

            if (form.confirm == 1)
            {
                this.encours = false;

                int packageid = 0;
                int packtermid = 0;

                EA.Package pack0 = Repository.Models.GetAt(0);
                foreach (EA.Package package in pack0.Packages)
                {
                    foreach (EA.Package pack in package.Packages)
                    {
                        packageid = pack.PackageID;
                    }
                }
                pack0 = Repository.GetPackageByID(packageid);

                foreach (EA.Package packterm in pack0.Packages)
                {
                    if (packterm.Name == "Terms")
                        packtermid = packterm.PackageID;
                }
                if (packtermid == 0)
                {
                    EA.Collection collec = pack0.Packages;
                    EA.Package packterm = collec.AddNew("Terms", "Package");

                    packterm.Update();
                    collec.Refresh();
                    pack0.Update();
                    packtermid = packterm.PackageID;
                }

                EA.Collection newterm = Repository.GetPackageByID(packtermid).Elements;
                EA.Element term = newterm.AddNew(form.Term.Text, "Class");
                EA.Collection newtermattributes = term.Attributes;

                EA.Attribute att = newtermattributes.AddNew("term", "char");
                att.Default = form.Term.Text;
                att.Pos = 1;
                att.Update();

                att = newtermattributes.AddNew("definition", "char");
                att.Default = form.Definition.Text;
                att.Pos = 2;
                att.Update();

                newtermattributes.Refresh();
                term.Update();
                newterm.Refresh();

                Repository.RefreshModelView(packtermid);

            }

            this.encours = true;

        }
开发者ID:jzarca01,项目名称:ZamiGen_addin,代码行数:63,代码来源:Class1.cs

示例9: newversion

        public void newversion(EA.Repository Repository)
        {
            Form3 form = new Form3();
            form.ShowDialog();

            if (form.confirm == 1)
            {
                this.encours = false;

                int packageid = 0;
                int packversionid = 0;

                EA.Package pack0 = Repository.Models.GetAt(0);
                foreach (EA.Package package in pack0.Packages)
                {
                    foreach (EA.Package pack in package.Packages)
                    {
                        packageid = pack.PackageID;
                    }
                }
                pack0 = Repository.GetPackageByID(packageid);

                foreach (EA.Package packversion in pack0.Packages)
                {
                    if (packversion.Name == "Version")
                        packversionid = packversion.PackageID;
                }
                if (packversionid == 0)
                {
                    EA.Collection collec = pack0.Packages;
                    EA.Package packversion = collec.AddNew("Version", "Package");

                    packversion.Update();
                    collec.Refresh();
                    pack0.Update();
                    packversionid = packversion.PackageID;
                }

                EA.Collection newversion = Repository.GetPackageByID(packversionid).Elements;
                EA.Element version = newversion.AddNew("Version" + form.number.Text, "Class");
                EA.Collection newversionattributes = version.Attributes;

                EA.Attribute att = newversionattributes.AddNew("number", "char");
                att.Default = form.number.Text;
                att.Pos = 1;
                att.Update();

                att = newversionattributes.AddNew("date", "char");
                att.Default = form.Date.Text;
                att.Pos = 2;
                att.Update();

                att = newversionattributes.AddNew("author", "char");
                att.Default = form.author.Text;
                att.Pos = 3;
                att.Update();

                att = newversionattributes.AddNew("changes", "char");
                att.Default = form.Changes.Text;
                att.Pos = 4;
                att.Update();

                att = newversionattributes.AddNew("status", "char");
                att.Default = form.Status.Text;
                att.Pos = 5;
                att.Update();

                newversionattributes.Refresh();
                version.Update();
                newversion.Refresh();

                Repository.RefreshModelView(packversionid);

            }

            this.encours = true;

        }
开发者ID:jzarca01,项目名称:ZamiGen_addin,代码行数:78,代码来源:Class1.cs


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