0

有没有办法在 Cruisecontrol.net 1.6 中混淆“AND”和“OR”运算符?我的 if 条件是这样的:

if ((A="a" && a="a") || (B="b" && b="b"))
{
    //Task to be done
}

用 CC(OR 部分)编写时也是如此:

<conditional>
    <conditions>
        <orCondition>
            <conditions>
                <compareCondition value1="A" evaluation="equal" value2="a" />
                <compareCondition value1="B" evaluation="equal" value2="b" />
            </conditions>
        </orCondition>
    </conditions>
    <tasks>
        <!--Task to be done-->
    </tasks>
</conditional>

当在 CC 中使用 AND 部分编写时:

<conditional>
    <conditions>
        <andCondition>
            <conditions>
                <compareCondition value1="a" evaluation="equal" value2="a" />
                <compareCondition value1="b" evaluation="equal" value2="b" />
            </conditions>
        </andCondition>
    </conditions>
    <tasks>
        <!--Task to be done-->
    </tasks>
</conditional>

我想把这两个写成一个条件操作。是否可以?

4

1 回答 1

1

好吧,我自己想通了... :)

<conditional>
    <conditions>
        <orCondition>
            <conditions>
                <andCondition>
                    <conditions>
                        <compareCondition value1="A" evaluation="equal" value2="a" />
                        <compareCondition value1="a" evaluation="equal" value2="a" />
                    </conditions>
                </andCondition>
                <andCondition>
                    <conditions>
                        <compareCondition value1="B" evaluation="equal" value2="b" />
                        <compareCondition value1="b" evaluation="equal" value2="b" />
                    </conditions>
                </andCondition>
            </conditions>
        </orCondition>
    </conditions>
    <tasks>
        <!--Task to be done-->
    </tasks>
</conditional>
于 2012-09-13T11:09:36.057 回答