本文整理汇总了C#中System.Condition.Or方法的典型用法代码示例。如果您正苦于以下问题:C# Condition.Or方法的具体用法?C# Condition.Or怎么用?C# Condition.Or使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Condition
的用法示例。
在下文中一共展示了Condition.Or方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: PushBlock
private void PushBlock(string tag, string markup)
{
Condition block;
if (tag == "else")
{
block = new ElseCondition();
}
else
{
List<string> expressions = R.Scan(markup, ExpressionsAndOperators);
expressions.Reverse();
string syntax = expressions.Shift();
if (string.IsNullOrEmpty(syntax))
throw new SyntaxException(SyntaxHelp);
Match syntaxMatch = Syntax.Match(syntax);
if (!syntaxMatch.Success)
throw new SyntaxException(SyntaxHelp);
Condition condition = new Condition(syntaxMatch.Groups[1].Value,
syntaxMatch.Groups[2].Value, syntaxMatch.Groups[3].Value);
while (expressions.Any())
{
string @operator = expressions.Shift().Trim();
Match expressionMatch = Syntax.Match(expressions.Shift());
if (!expressionMatch.Success)
throw new SyntaxException(SyntaxHelp);
Condition newCondition = new Condition(expressionMatch.Groups[1].Value,
expressionMatch.Groups[2].Value, expressionMatch.Groups[3].Value);
switch (@operator)
{
case "and":
newCondition.And(condition);
break;
case "or":
newCondition.Or(condition);
break;
}
condition = newCondition;
}
block = condition;
}
Blocks.Add(block);
NodeList = block.Attach(new List<object>());
}