本文整理匯總了C#中System.Condition.And方法的典型用法代碼示例。如果您正苦於以下問題:C# Condition.And方法的具體用法?C# Condition.And怎麽用?C# Condition.And使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類System.Condition
的用法示例。
在下文中一共展示了Condition.And方法的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>());
}