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


C# Generated.allSubSteps方法代码示例

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


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

示例1: compareTranslation

        /// <summary>
        /// Compares two Translation and annotates the differences on the first one
        /// </summary>
        /// <param name="obj"></param>
        /// <param name="other"></param>
        public static void compareTranslation(Generated.Translation obj, Generated.Translation other, VersionDiff diff)
        {
            if ( other == null )
            {
                diff.appendChanges ( new Diff(obj, HistoricalData.Generated.acceptor.ChangeOperationEnum.aAdd, "", "", obj.Name ) );
                return;
            }

            compareReferencesParagraph (obj, other, diff);

            if ( obj.allSourceTexts() != null )
            {
                if ( other.allSourceTexts() != null )
                {
                    foreach ( Generated.SourceText subElement in obj.allSourceTexts() )
                    {
                        bool compared = false;
                        foreach ( Generated.SourceText otherElement in other.allSourceTexts() )
                        {
                            if ( subElement.Guid == otherElement.Guid )
                            {
                                compareSourceText ( subElement, otherElement, diff );
                                compared = true;
                            break;
                            }
                        }

                        if ( !compared )
                        {
                            diff.appendChanges ( new Diff(subElement, HistoricalData.Generated.acceptor.ChangeOperationEnum.aAdd, "SourceTexts", "", subElement.Name ) );
                        }
                    }

                    foreach ( Generated.SourceText otherElement in other.allSourceTexts() )
                    {
                        bool found = false;
                        foreach ( Generated.SourceText subElement in obj.allSourceTexts() )
                        {
                            if ( subElement.Guid == otherElement.Guid )
                            {
                                found = true;
                                break;
                            }
                        }

                        if ( !found )
                        {
                            diff.appendChanges ( new Diff(obj, HistoricalData.Generated.acceptor.ChangeOperationEnum.aRemove , "SourceTexts", otherElement.Name) );
                        }
                    }
                }
                else
                {
                    foreach ( Generated.SourceText subElement in obj.allSourceTexts() )
                    {
                        diff.appendChanges ( new Diff(subElement, HistoricalData.Generated.acceptor.ChangeOperationEnum.aAdd, "SourceTexts", "", subElement.Name ) );
                    }
                }
            }
            else
            {
                if ( other.allSourceTexts() != null )
                {
                    foreach ( Generated.SourceText otherElement in other.allSourceTexts() )
                    {
                        diff.appendChanges ( new Diff(obj, HistoricalData.Generated.acceptor.ChangeOperationEnum.aRemove , "SourceTexts", otherElement.Name) );
                    }
                }
            }
            if ( obj.getImplemented() != other.getImplemented() )
            {
                diff.appendChanges ( new Diff(obj, HistoricalData.Generated.acceptor.ChangeOperationEnum.aChange, "Implemented", other.getImplemented().ToString(), obj.getImplemented().ToString()) );
            }
            if ( obj.allSubSteps() != null )
            {
                if ( other.allSubSteps() != null )
                {
                    foreach ( Generated.SubStep subElement in obj.allSubSteps() )
                    {
                        bool compared = false;
                        foreach ( Generated.SubStep otherElement in other.allSubSteps() )
                        {
                            if ( subElement.Guid == otherElement.Guid )
                            {
                                compareSubStep ( subElement, otherElement, diff );
                                compared = true;
                            break;
                            }
                        }

                        if ( !compared )
                        {
                            diff.appendChanges ( new Diff(subElement, HistoricalData.Generated.acceptor.ChangeOperationEnum.aAdd, "SubSteps", "", subElement.Name ) );
                        }
                    }
//.........这里部分代码省略.........
开发者ID:nikiforovandrey,项目名称:ERTMSFormalSpecs,代码行数:101,代码来源:Comparer.cs

示例2: compareStep

        /// <summary>
        /// Compares two Step and annotates the differences on the first one
        /// </summary>
        /// <param name="obj"></param>
        /// <param name="other"></param>
        public static void compareStep(Generated.Step obj, Generated.Step other, VersionDiff diff)
        {
            if ( other == null )
            {
                diff.appendChanges ( new Diff(obj, HistoricalData.Generated.acceptor.ChangeOperationEnum.aAdd, "", "", obj.Name ) );
                return;
            }

            compareReferencesParagraph (obj, other, diff);

            if ( obj.getTCS_Order() != other.getTCS_Order() )
            {
                diff.appendChanges ( new Diff(obj, HistoricalData.Generated.acceptor.ChangeOperationEnum.aChange, "TCS_Order", other.getTCS_Order().ToString(), obj.getTCS_Order().ToString()) );
            }
            if ( obj.getDistance() != other.getDistance() )
            {
                diff.appendChanges ( new Diff(obj, HistoricalData.Generated.acceptor.ChangeOperationEnum.aChange, "Distance", other.getDistance().ToString(), obj.getDistance().ToString()) );
            }
            if ( !CompareUtil.canonicalStringEquality(obj.getDescription(), other.getDescription()) )
            {
                diff.appendChanges ( new Diff(obj, HistoricalData.Generated.acceptor.ChangeOperationEnum.aChange, "Description", other.getDescription(), obj.getDescription()) );
            }
            if ( !CompareUtil.canonicalStringEquality(obj.getObsoleteComment(), other.getObsoleteComment()) )
            {
                diff.appendChanges ( new Diff(obj, HistoricalData.Generated.acceptor.ChangeOperationEnum.aChange, "ObsoleteComment", other.getObsoleteComment(), obj.getObsoleteComment()) );
            }
            if ( !CompareUtil.canonicalStringEquality(obj.getUserComment(), other.getUserComment()) )
            {
                diff.appendChanges ( new Diff(obj, HistoricalData.Generated.acceptor.ChangeOperationEnum.aChange, "UserComment", other.getUserComment(), obj.getUserComment()) );
            }
            if ( obj.getIO() != other.getIO() )
            {
                diff.appendChanges ( new Diff(obj, HistoricalData.Generated.acceptor.ChangeOperationEnum.aChange, "IO", other.getIO().ToString(), obj.getIO().ToString()) );
            }
            if ( obj.getInterface() != other.getInterface() )
            {
                diff.appendChanges ( new Diff(obj, HistoricalData.Generated.acceptor.ChangeOperationEnum.aChange, "Interface", other.getInterface().ToString(), obj.getInterface().ToString()) );
            }
            if ( obj.getLevelIN() != other.getLevelIN() )
            {
                diff.appendChanges ( new Diff(obj, HistoricalData.Generated.acceptor.ChangeOperationEnum.aChange, "LevelIN", other.getLevelIN().ToString(), obj.getLevelIN().ToString()) );
            }
            if ( obj.getLevelOUT() != other.getLevelOUT() )
            {
                diff.appendChanges ( new Diff(obj, HistoricalData.Generated.acceptor.ChangeOperationEnum.aChange, "LevelOUT", other.getLevelOUT().ToString(), obj.getLevelOUT().ToString()) );
            }
            if ( obj.getModeIN() != other.getModeIN() )
            {
                diff.appendChanges ( new Diff(obj, HistoricalData.Generated.acceptor.ChangeOperationEnum.aChange, "ModeIN", other.getModeIN().ToString(), obj.getModeIN().ToString()) );
            }
            if ( obj.getModeOUT() != other.getModeOUT() )
            {
                diff.appendChanges ( new Diff(obj, HistoricalData.Generated.acceptor.ChangeOperationEnum.aChange, "ModeOUT", other.getModeOUT().ToString(), obj.getModeOUT().ToString()) );
            }
            if ( obj.getTranslationRequired() != other.getTranslationRequired() )
            {
                diff.appendChanges ( new Diff(obj, HistoricalData.Generated.acceptor.ChangeOperationEnum.aChange, "TranslationRequired", other.getTranslationRequired().ToString(), obj.getTranslationRequired().ToString()) );
            }
            if ( obj.getTranslated() != other.getTranslated() )
            {
                diff.appendChanges ( new Diff(obj, HistoricalData.Generated.acceptor.ChangeOperationEnum.aChange, "Translated", other.getTranslated().ToString(), obj.getTranslated().ToString()) );
            }
            if ( obj.allSubSteps() != null )
            {
                if ( other.allSubSteps() != null )
                {
                    foreach ( Generated.SubStep subElement in obj.allSubSteps() )
                    {
                        bool compared = false;
                        foreach ( Generated.SubStep otherElement in other.allSubSteps() )
                        {
                            if ( subElement.Guid == otherElement.Guid )
                            {
                                compareSubStep ( subElement, otherElement, diff );
                                compared = true;
                            break;
                            }
                        }

                        if ( !compared )
                        {
                            diff.appendChanges ( new Diff(subElement, HistoricalData.Generated.acceptor.ChangeOperationEnum.aAdd, "SubSteps", "", subElement.Name ) );
                        }
                    }

                    foreach ( Generated.SubStep otherElement in other.allSubSteps() )
                    {
                        bool found = false;
                        foreach ( Generated.SubStep subElement in obj.allSubSteps() )
                        {
                            if ( subElement.Guid == otherElement.Guid )
                            {
                                found = true;
                                break;
                            }
//.........这里部分代码省略.........
开发者ID:nikiforovandrey,项目名称:ERTMSFormalSpecs,代码行数:101,代码来源:Comparer.cs

示例3: searchStep

        /// <summary>
        /// Searches a specific string in Step and updates the list 
        /// of model element with all the elements in which that string is found
        /// </summary>
        /// <param name="obj"></param>
        /// <param name="obj">The string to search for</param>
        /// <param name="occurences">The list of model elements which hold the searched string</param>
        public static void searchStep(Generated.Step obj, string searchString, List<ModelElement> occurences)
        {
            searchReferencesParagraph (obj, searchString, occurences);

            if ( obj.getDescription() != null && obj.getDescription().Contains (searchString) )
            {
                occurences.Add ( obj );
            }
            if ( obj.getObsoleteComment() != null && obj.getObsoleteComment().Contains (searchString) )
            {
                occurences.Add ( obj );
            }
            if ( obj.getUserComment() != null && obj.getUserComment().Contains (searchString) )
            {
                occurences.Add ( obj );
            }
            if ( obj.allSubSteps() != null )
            {
                foreach ( Generated.SubStep subElement in obj.allSubSteps() )
                {
                    searchSubStep ( subElement, searchString, occurences );
                }
            }
            if ( obj.allMessages() != null )
            {
                foreach ( Generated.DBMessage subElement in obj.allMessages() )
                {
                    searchDBMessage ( subElement, searchString, occurences );
                }
            }
        }
开发者ID:nikiforovandrey,项目名称:ERTMSFormalSpecs,代码行数:38,代码来源:Comparer.cs

示例4: searchTranslation

        /// <summary>
        /// Searches a specific string in Translation and updates the list 
        /// of model element with all the elements in which that string is found
        /// </summary>
        /// <param name="obj"></param>
        /// <param name="obj">The string to search for</param>
        /// <param name="occurences">The list of model elements which hold the searched string</param>
        public static void searchTranslation(Generated.Translation obj, string searchString, List<ModelElement> occurences)
        {
            searchReferencesParagraph (obj, searchString, occurences);

            if ( obj.allSourceTexts() != null )
            {
                foreach ( Generated.SourceText subElement in obj.allSourceTexts() )
                {
                    searchSourceText ( subElement, searchString, occurences );
                }
            }
            if ( obj.getObsoleteComment() != null && obj.getObsoleteComment().Contains (searchString) )
            {
                occurences.Add ( obj );
            }
            if ( obj.allSubSteps() != null )
            {
                foreach ( Generated.SubStep subElement in obj.allSubSteps() )
                {
                    searchSubStep ( subElement, searchString, occurences );
                }
            }
        }
开发者ID:nikiforovandrey,项目名称:ERTMSFormalSpecs,代码行数:30,代码来源:Comparer.cs

示例5: ensureGuidTranslation


//.........这里部分代码省略.........
                        foreach ( Generated.SourceText subElement in obj.allSourceTexts() )
                        {
                            if ( CompareUtil.canonicalStringEquality(subElement.Name, otherElement.Name) )
                            {
                                found = true;
                                break;
                            }
                        }

                        if ( !found )
                        {
                            ensureGuidSourceText ( null, otherElement );
                        }
                    }
                }
                else
                {
                    foreach ( Generated.SourceText subElement in obj.allSourceTexts() )
                    {
                        ensureGuidSourceText ( subElement, null );
                    }
                }
            }
            else
            {
                if ( other.allSourceTexts() != null )
                {
                    foreach ( Generated.SourceText otherElement in other.allSourceTexts() )
                    {
                        ensureGuidSourceText ( null, otherElement );
                    }
                }
            }
            if ( obj.allSubSteps() != null )
            {
                if ( other.allSubSteps() != null )
                {
                    foreach ( Generated.SubStep subElement in obj.allSubSteps() )
                    {
                        bool found = false;

                        // Try first to assign Guid to elements which do not have a guid
                        // This helps handling duplicated in lists
                        foreach ( Generated.SubStep otherElement in other.allSubSteps() )
                        {
                            if ( CompareUtil.canonicalStringEquality(subElement.Name, otherElement.Name) && otherElement.getGuid() == null )
                            {
                                ensureGuidSubStep ( subElement, otherElement );
                                found = true;
                                break;
                            }
                        }

                        if ( !found )
                        {
                            foreach ( Generated.SubStep otherElement in other.allSubSteps() )
                            {
                                if ( CompareUtil.canonicalStringEquality(subElement.Name, otherElement.Name) )
                                {
                                    ensureGuidSubStep ( subElement, otherElement );
                                    found = true;
                                    break;
                                }
                            }
                        }
开发者ID:nikiforovandrey,项目名称:ERTMSFormalSpecs,代码行数:66,代码来源:Comparer.cs


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