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


C# Generated.allActions方法代码示例

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


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

示例1: compareSubStep

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

            compareNamable (obj, other, diff);

            if ( obj.allActions() != null )
            {
                if ( other.allActions() != null )
                {
                    int i = 0;
                    while ( i < obj.countActions() && i < other.countActions() )
                    {
                        Generated.Action element = obj.getActions( i );
                        Generated.Action otherElement = other.getActions( i );
                        compareAction ( element, otherElement, diff );
                        i += 1;
                    }
                    while ( i < obj.countActions() )
                    {
                        diff.appendChanges ( new Diff(obj.getActions(i), HistoricalData.Generated.acceptor.ChangeOperationEnum.aAdd, "Actions", "", obj.getActions( i ).Name ) );
                        i += 1;
                    }
                    while ( i < other.countActions() )
                    {
                        diff.appendChanges ( new Diff(obj, HistoricalData.Generated.acceptor.ChangeOperationEnum.aRemove, "Actions", other.getActions( i ).Name) );
                        i += 1;
                    }
                }
                else
                {
                    foreach ( Generated.Action subElement in obj.allActions() )
                    {
                        diff.appendChanges ( new Diff(subElement, HistoricalData.Generated.acceptor.ChangeOperationEnum.aAdd, "Actions", "", subElement.Name ) );
                    }
                }
            }
            else
            {
                if ( other.allActions() != null )
                {
                    foreach ( Generated.Action otherElement in other.allActions() )
                    {
                        diff.appendChanges ( new Diff(obj, HistoricalData.Generated.acceptor.ChangeOperationEnum.aRemove , "Actions", otherElement.Name) );
                    }
                }
            }
            if ( obj.allExpectations() != null )
            {
                if ( other.allExpectations() != null )
                {
                    int i = 0;
                    while ( i < obj.countExpectations() && i < other.countExpectations() )
                    {
                        Generated.Expectation element = obj.getExpectations( i );
                        Generated.Expectation otherElement = other.getExpectations( i );
                        compareExpectation ( element, otherElement, diff );
                        i += 1;
                    }
                    while ( i < obj.countExpectations() )
                    {
                        diff.appendChanges ( new Diff(obj.getExpectations(i), HistoricalData.Generated.acceptor.ChangeOperationEnum.aAdd, "Expectations", "", obj.getExpectations( i ).Name ) );
                        i += 1;
                    }
                    while ( i < other.countExpectations() )
                    {
                        diff.appendChanges ( new Diff(obj, HistoricalData.Generated.acceptor.ChangeOperationEnum.aRemove, "Expectations", other.getExpectations( i ).Name) );
                        i += 1;
                    }
                }
                else
                {
                    foreach ( Generated.Expectation subElement in obj.allExpectations() )
                    {
                        diff.appendChanges ( new Diff(subElement, HistoricalData.Generated.acceptor.ChangeOperationEnum.aAdd, "Expectations", "", subElement.Name ) );
                    }
                }
            }
            else
            {
                if ( other.allExpectations() != null )
                {
                    foreach ( Generated.Expectation otherElement in other.allExpectations() )
                    {
                        diff.appendChanges ( new Diff(obj, HistoricalData.Generated.acceptor.ChangeOperationEnum.aRemove , "Expectations", otherElement.Name) );
                    }
                }
            }
            if ( obj.getSkipEngine() != other.getSkipEngine() )
            {
                diff.appendChanges ( new Diff(obj, HistoricalData.Generated.acceptor.ChangeOperationEnum.aChange, "SkipEngine", other.getSkipEngine().ToString(), obj.getSkipEngine().ToString()) );
//.........这里部分代码省略.........
开发者ID:nikiforovandrey,项目名称:ERTMSFormalSpecs,代码行数:101,代码来源:Comparer.cs

示例2: compareRuleCondition

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

            compareReqRelated (obj, other, diff);

            if ( obj.allPreConditions() != null )
            {
                if ( other.allPreConditions() != null )
                {
                    int i = 0;
                    while ( i < obj.countPreConditions() && i < other.countPreConditions() )
                    {
                        Generated.PreCondition element = obj.getPreConditions( i );
                        Generated.PreCondition otherElement = other.getPreConditions( i );
                        comparePreCondition ( element, otherElement, diff );
                        i += 1;
                    }
                    while ( i < obj.countPreConditions() )
                    {
                        diff.appendChanges ( new Diff(obj.getPreConditions(i), HistoricalData.Generated.acceptor.ChangeOperationEnum.aAdd, "PreConditions", "", obj.getPreConditions( i ).Name ) );
                        i += 1;
                    }
                    while ( i < other.countPreConditions() )
                    {
                        diff.appendChanges ( new Diff(obj, HistoricalData.Generated.acceptor.ChangeOperationEnum.aRemove, "PreConditions", other.getPreConditions( i ).Name) );
                        i += 1;
                    }
                }
                else
                {
                    foreach ( Generated.PreCondition subElement in obj.allPreConditions() )
                    {
                        diff.appendChanges ( new Diff(subElement, HistoricalData.Generated.acceptor.ChangeOperationEnum.aAdd, "PreConditions", "", subElement.Name ) );
                    }
                }
            }
            else
            {
                if ( other.allPreConditions() != null )
                {
                    foreach ( Generated.PreCondition otherElement in other.allPreConditions() )
                    {
                        diff.appendChanges ( new Diff(obj, HistoricalData.Generated.acceptor.ChangeOperationEnum.aRemove , "PreConditions", otherElement.Name) );
                    }
                }
            }
            if ( obj.allActions() != null )
            {
                if ( other.allActions() != null )
                {
                    int i = 0;
                    while ( i < obj.countActions() && i < other.countActions() )
                    {
                        Generated.Action element = obj.getActions( i );
                        Generated.Action otherElement = other.getActions( i );
                        compareAction ( element, otherElement, diff );
                        i += 1;
                    }
                    while ( i < obj.countActions() )
                    {
                        diff.appendChanges ( new Diff(obj.getActions(i), HistoricalData.Generated.acceptor.ChangeOperationEnum.aAdd, "Actions", "", obj.getActions( i ).Name ) );
                        i += 1;
                    }
                    while ( i < other.countActions() )
                    {
                        diff.appendChanges ( new Diff(obj, HistoricalData.Generated.acceptor.ChangeOperationEnum.aRemove, "Actions", other.getActions( i ).Name) );
                        i += 1;
                    }
                }
                else
                {
                    foreach ( Generated.Action subElement in obj.allActions() )
                    {
                        diff.appendChanges ( new Diff(subElement, HistoricalData.Generated.acceptor.ChangeOperationEnum.aAdd, "Actions", "", subElement.Name ) );
                    }
                }
            }
            else
            {
                if ( other.allActions() != null )
                {
                    foreach ( Generated.Action otherElement in other.allActions() )
                    {
                        diff.appendChanges ( new Diff(obj, HistoricalData.Generated.acceptor.ChangeOperationEnum.aRemove , "Actions", otherElement.Name) );
                    }
                }
            }
            if ( obj.allSubRules() != null )
            {
                if ( other.allSubRules() != null )
//.........这里部分代码省略.........
开发者ID:nikiforovandrey,项目名称:ERTMSFormalSpecs,代码行数:101,代码来源:Comparer.cs

示例3: searchSubStep

        /// <summary>
        /// Searches a specific string in SubStep 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 searchSubStep(Generated.SubStep obj, string searchString, List<ModelElement> occurences)
        {
            searchNamable (obj, searchString, occurences);

            if ( obj.allActions() != null )
            {
                foreach ( Generated.Action subElement in obj.allActions() )
                {
                    searchAction ( subElement, searchString, occurences );
                }
            }
            if ( obj.allExpectations() != null )
            {
                foreach ( Generated.Expectation subElement in obj.allExpectations() )
                {
                    searchExpectation ( subElement, searchString, occurences );
                }
            }
            if ( obj.getComment() != null && obj.getComment().Contains (searchString) )
            {
                occurences.Add ( obj );
            }
        }
开发者ID:nikiforovandrey,项目名称:ERTMSFormalSpecs,代码行数:30,代码来源:Comparer.cs

示例4: searchRuleCondition

        /// <summary>
        /// Searches a specific string in RuleCondition 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 searchRuleCondition(Generated.RuleCondition obj, string searchString, List<ModelElement> occurences)
        {
            searchReqRelated (obj, searchString, occurences);

            if ( obj.allPreConditions() != null )
            {
                foreach ( Generated.PreCondition subElement in obj.allPreConditions() )
                {
                    searchPreCondition ( subElement, searchString, occurences );
                }
            }
            if ( obj.allActions() != null )
            {
                foreach ( Generated.Action subElement in obj.allActions() )
                {
                    searchAction ( subElement, searchString, occurences );
                }
            }
            if ( obj.allSubRules() != null )
            {
                foreach ( Generated.Rule subElement in obj.allSubRules() )
                {
                    searchRule ( subElement, searchString, occurences );
                }
            }
        }
开发者ID:nikiforovandrey,项目名称:ERTMSFormalSpecs,代码行数:33,代码来源:Comparer.cs

示例5: ensureGuidSubStep

        /// <summary>
        /// Ensures that two SubStep have matching GUID, and recursively.
        /// obj is the leader for Guid. If other doesn't match obj guid, 
        ///   1. other does not have a guid, in that case, other should have the same guid as obj
        ///   2. other already has a guid. In that case, there is a mismatch between objects, and the process stops here
        /// </summary>
        /// <param name="obj"></param>
        /// <param name="other"></param>
        public static void ensureGuidSubStep(Generated.SubStep obj, Generated.SubStep other)
        {
            if ( obj == null )
            {
                if ( other != null )
                {
                    // Side effect, setup a GUID if needed for the other part (other)
                    string guid = other.Guid;
                }
                return;
            }

            if ( other == null )
            {
                if ( obj != null )
                {
                    // Side effect, setup a GUID if needed for the other part (obj)
                    string guid = obj.Guid;
                }
                return;
            }

            if ( obj.Guid != other.getGuid() )
            {
                if ( string.IsNullOrEmpty(other.getGuid()) || GuidByName && (obj.Name == other.Name) )
                {
                    // These are matching elements, copy the guid from  obj
                    other.setGuid ( obj.Guid );
                }
                else
                {
                    // Elements do not match. Stop the recursive process
                    return;
                }
            }

            ensureGuidNamable (obj, other);

            if ( obj.allActions() != null )
            {
                if ( other.allActions() != null )
                {
                    int i = 0;
                    while ( i < obj.countActions() && i < other.countActions() )
                    {
                        Generated.Action element = obj.getActions( i );
                        Generated.Action otherElement = other.getActions( i );
                        ensureGuidAction ( element, otherElement );
                        i += 1;
                    }
                    while ( i < obj.countActions() )
                    {
                        Generated.Action element = obj.getActions( i );
                        ensureGuidAction ( element, null );
                        i += 1;
                    }
                    while ( i < other.countActions() )
                    {
                        Generated.Action otherElement = other.getActions( i );
                        ensureGuidAction ( null, otherElement );
                        i += 1;
                    }
                }
                else
                {
                    foreach ( Generated.Action subElement in obj.allActions() )
                    {
                        ensureGuidAction ( subElement, null );
                    }
                }
            }
            else
            {
                if ( other.allActions() != null )
                {
                    foreach ( Generated.Action otherElement in other.allActions() )
                    {
                        ensureGuidAction ( null, otherElement );
                    }
                }
            }
            if ( obj.allExpectations() != null )
            {
                if ( other.allExpectations() != null )
                {
                    int i = 0;
                    while ( i < obj.countExpectations() && i < other.countExpectations() )
                    {
                        Generated.Expectation element = obj.getExpectations( i );
                        Generated.Expectation otherElement = other.getExpectations( i );
                        ensureGuidExpectation ( element, otherElement );
                        i += 1;
//.........这里部分代码省略.........
开发者ID:nikiforovandrey,项目名称:ERTMSFormalSpecs,代码行数:101,代码来源:Comparer.cs

示例6: ensureGuidRuleCondition

        /// <summary>
        /// Ensures that two RuleCondition have matching GUID, and recursively.
        /// obj is the leader for Guid. If other doesn't match obj guid, 
        ///   1. other does not have a guid, in that case, other should have the same guid as obj
        ///   2. other already has a guid. In that case, there is a mismatch between objects, and the process stops here
        /// </summary>
        /// <param name="obj"></param>
        /// <param name="other"></param>
        public static void ensureGuidRuleCondition(Generated.RuleCondition obj, Generated.RuleCondition other)
        {
            if ( obj == null )
            {
                if ( other != null )
                {
                    // Side effect, setup a GUID if needed for the other part (other)
                    string guid = other.Guid;
                }
                return;
            }

            if ( other == null )
            {
                if ( obj != null )
                {
                    // Side effect, setup a GUID if needed for the other part (obj)
                    string guid = obj.Guid;
                }
                return;
            }

            if ( obj.Guid != other.getGuid() )
            {
                if ( string.IsNullOrEmpty(other.getGuid()) || GuidByName && (obj.Name == other.Name) )
                {
                    // These are matching elements, copy the guid from  obj
                    other.setGuid ( obj.Guid );
                }
                else
                {
                    // Elements do not match. Stop the recursive process
                    return;
                }
            }

            ensureGuidReqRelated (obj, other);

            if ( obj.allPreConditions() != null )
            {
                if ( other.allPreConditions() != null )
                {
                    int i = 0;
                    while ( i < obj.countPreConditions() && i < other.countPreConditions() )
                    {
                        Generated.PreCondition element = obj.getPreConditions( i );
                        Generated.PreCondition otherElement = other.getPreConditions( i );
                        ensureGuidPreCondition ( element, otherElement );
                        i += 1;
                    }
                    while ( i < obj.countPreConditions() )
                    {
                        Generated.PreCondition element = obj.getPreConditions( i );
                        ensureGuidPreCondition ( element, null );
                        i += 1;
                    }
                    while ( i < other.countPreConditions() )
                    {
                        Generated.PreCondition otherElement = other.getPreConditions( i );
                        ensureGuidPreCondition ( null, otherElement );
                        i += 1;
                    }
                }
                else
                {
                    foreach ( Generated.PreCondition subElement in obj.allPreConditions() )
                    {
                        ensureGuidPreCondition ( subElement, null );
                    }
                }
            }
            else
            {
                if ( other.allPreConditions() != null )
                {
                    foreach ( Generated.PreCondition otherElement in other.allPreConditions() )
                    {
                        ensureGuidPreCondition ( null, otherElement );
                    }
                }
            }
            if ( obj.allActions() != null )
            {
                if ( other.allActions() != null )
                {
                    int i = 0;
                    while ( i < obj.countActions() && i < other.countActions() )
                    {
                        Generated.Action element = obj.getActions( i );
                        Generated.Action otherElement = other.getActions( i );
                        ensureGuidAction ( element, otherElement );
                        i += 1;
//.........这里部分代码省略.........
开发者ID:nikiforovandrey,项目名称:ERTMSFormalSpecs,代码行数:101,代码来源:Comparer.cs


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