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


C# DataDictionary.FindParagraph方法代码示例

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


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

示例1: PerformDelta

        /// <summary>
        /// Performs the delta on the specification provided
        /// </summary>
        /// <param name="delta"></param>
        /// <param name="specifications"></param>
        private void PerformDelta(DataDictionary.Specification.Specification specifications)
        {
            foreach (Paragraph p in NewDocument.ChangedParagraphs)
            {
                DataDictionary.Specification.Paragraph par = specifications.FindParagraph(p.Id);

                if (par != null)
                {
                    par.Text = p.Text;
                    par.AddInfo("Paragraph has been changed");
                    par.setImplementationStatus(DataDictionary.Generated.acceptor.SPEC_IMPLEMENTED_ENUM.Impl_NewRevisionAvailable);
                    par.setReviewed(false);
                    foreach (DataDictionary.ReqRef reqRef in par.Implementations)
                    {
                        DataDictionary.ReqRelated reqRelated = reqRef.Model as DataDictionary.ReqRelated;
                        if (reqRelated != null)
                        {
                            reqRelated.setImplemented(false);
                            reqRelated.setVerified(false);
                        }
                    }
                }
                else
                {
                    AddError(specifications, p, "Cannot find paragraph " + p.Id + " for modification");
                }
            }

            foreach (Paragraph p in NewDocument.NewParagraphs)
            {
                DataDictionary.Specification.Paragraph par = specifications.FindParagraph(p.Id);

                if (par != null)
                {
                    AddError(specifications, p, "Paragraph " + p.Id + " already exists, whereas it has been detected as a new paragraph in the release");
                }
                else
                {
                    par = specifications.FindParagraph(p.Id, true);
                    if (par != null)
                    {
                        par.setText(p.Text);
                        par.AddInfo("New paragraph");
                    }
                    else
                    {
                        AddError(specifications, p, "Paragraph " + p.Id + " cannot be found in the specification");
                    }
                }
            }

            foreach (Paragraph p in NewDocument.RemovedParagraphs)
            {
                DataDictionary.Specification.Paragraph par = specifications.FindParagraph(p.Id);

                if (par != null)
                {
                    par.Text = "<Removed in current release>";
                    par.AddInfo("Paragraph has been removed");
                }
                else
                {
                    AddError(specifications, p, "Cannot find paragraph " + p.Id + " for removal");
                }
            }
        }
开发者ID:Assmann-Siemens,项目名称:ERTMSFormalSpecs,代码行数:71,代码来源:Importer.cs


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