本文整理汇总了C#中BinaryOperator类的典型用法代码示例。如果您正苦于以下问题:C# BinaryOperator类的具体用法?C# BinaryOperator怎么用?C# BinaryOperator使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
BinaryOperator类属于命名空间,在下文中一共展示了BinaryOperator类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: TypeOperation
public static IExpressionGraph TypeOperation(IExpressionGraph myLeftValueObject, IExpressionGraph myRightValueObject, BinaryOperator myOperator)
{
switch (myOperator)
{
case BinaryOperator.AND:
myLeftValueObject.IntersectWith(myRightValueObject);
break;
case BinaryOperator.OR:
myLeftValueObject.UnionWith(myRightValueObject);
break;
case BinaryOperator.Equals:
case BinaryOperator.GreaterOrEqualsThan:
case BinaryOperator.GreaterThan:
case BinaryOperator.InRange:
case BinaryOperator.LessOrEqualsThan:
case BinaryOperator.LessThan:
case BinaryOperator.NotEquals:
default:
throw new ArgumentOutOfRangeException("myOperator");
}
return myLeftValueObject;
}
示例2: Visit
public virtual void Visit(BinaryOperator node)
{
if (node != null)
{
AcceptChildren(node);
}
}
示例3: Visit
public void Visit(BinaryOperator op)
{
op.LeftOperand.Accept(this);
_resultBuilder.Append(" ");
op.RightOperand.Accept(this);
_resultBuilder.Append("binary");
}
示例4: BinaryExpression
// ||, &&, ==, !=
// +, -, *, /, %
public BinaryExpression(CssValue left, BinaryOperator op, CssValue right)
: base(NodeKind.Expression)
{
Left = left;
Operator = op;
Right = right;
}
示例5: BinaryExpression
public BinaryExpression(BinaryOperator @operator, Expression left, Expression right,
TypeReference expressionType, TypeSystem typeSystem, IEnumerable<Instruction> instructions, bool isOverridenOperation = false)
: this(@operator, left, right, DetermineIsChecked(instructions), instructions, isOverridenOperation)
{
this.ExpressionType = expressionType;
this.typeSystem = typeSystem;
}
示例6: GetCriteria
public static CriteriaOperator GetCriteria(Type serializationConfigurationType, ISerializationConfigurationGroup serializationConfigurationGroup)
{
const ISerializationConfiguration serializationConfiguration = null;
var groupOperator = new BinaryOperator(serializationConfiguration.GetPropertyName(x => x.SerializationConfigurationGroup),serializationConfigurationGroup);
return new GroupOperator(new BinaryOperator(serializationConfiguration.GetPropertyName(x => x.TypeToSerialize),
serializationConfigurationType), groupOperator);
}
示例7: CreateFilterCriteria
CriteriaOperator CreateFilterCriteria()
{
if (!Filter_words)
{ // точное совпадение
CriteriaOperator[] operators = new CriteriaOperator[_View.VisibleColumns.Count];
for (int i = 0; i < _View.VisibleColumns.Count; i++)
{
if (Filter_Plus)
operators[i] = new BinaryOperator(_View.VisibleColumns[i].FieldName, String.Format("%{0}%", _ActiveFilter), BinaryOperatorType.Like);
else
operators[i] = new BinaryOperator(_View.VisibleColumns[i].FieldName, String.Format("{0}%", _ActiveFilter), BinaryOperatorType.Like);
}
return new GroupOperator(GroupOperatorType.Or, operators);
}
else
{ // любое слово
CriteriaOperator[] levels = new CriteriaOperator[FilterText.Length];
for (int i = 0; i < FilterText.Length; i++)
{
CriteriaOperator[] operators = new CriteriaOperator[_View.VisibleColumns.Count + 1]; // Тэги + 1
for (int j = 0; j < _View.VisibleColumns.Count; j++)
{
operators[j] = new BinaryOperator(_View.VisibleColumns[j].FieldName, String.Format("%{0}%", FilterText[i]), BinaryOperatorType.Like);
}
// Тэги
operators[_View.VisibleColumns.Count] = new BinaryOperator("TagComments", String.Format("%{0}%", FilterText[i]), BinaryOperatorType.Like);
levels[i] = new GroupOperator(GroupOperatorType.Or, operators);
}
return new GroupOperator(GroupOperatorType.And, levels);
}
}
示例8:
object ICriteriaVisitor.Visit(BinaryOperator theOperator){
var propertyName = ((OperandProperty) theOperator.LeftOperand).PropertyName;
if (_dictionary.ContainsKey(propertyName)){
((OperandValue) theOperator.RightOperand).Value = _dictionary[propertyName];
}
return theOperator;
}
示例9: getGroupOperator
private static BinaryOperator getGroupOperator(out BinaryOperator binaryOperator2,
out CriteriaOperator groupOperator)
{
var binaryOperator = new BinaryOperator("dfs", 324);
binaryOperator2 = new BinaryOperator("sdfs", 3455);
groupOperator = new GroupOperator(binaryOperator, binaryOperator2);
return binaryOperator;
}
示例10: FindDefaultTemplate
public static ICodeTemplate FindDefaultTemplate(TemplateType templateType, Session session, Type codeTemplateType, CodeDomProvider codeDomProvider){
const ICodeTemplate template = null;
var binaryOperator = new BinaryOperator(template.GetPropertyName(x => x.TemplateType),templateType);
var isDefault = new BinaryOperator(template.GetPropertyName(x => x.IsDefault),true);
var provider = new BinaryOperator(template.GetPropertyName(x => x.CodeDomProvider),codeDomProvider);
return session.FindObject(PersistentCriteriaEvaluationBehavior.InTransaction,
codeTemplateType, new GroupOperator(binaryOperator, isDefault,provider))
as ICodeTemplate;
}
示例11: Process
object ICriteriaVisitor.Visit(BinaryOperator theOperator) {
Process(theOperator);
var leftOperandValue = GetCustomFunctionOperandValue(theOperator.LeftOperand);
if (!ReferenceEquals(leftOperandValue,null))
theOperator.LeftOperand=leftOperandValue;
var rightOperandValue = GetCustomFunctionOperandValue(theOperator.RightOperand);
if (!ReferenceEquals(rightOperandValue,null))
theOperator.RightOperand=rightOperandValue;
return theOperator;
}
示例12: BinaryFormula
/// <summary>
/// Initializes a new instance of the <see cref="BinaryFormula" /> class.
/// </summary>
/// <param name="leftOperand">The formula on the left-hand side of the binary operator.</param>
/// <param name="binaryOperator">The operator of the binary formula.</param>
/// <param name="rightOperand">The formula on the right-hand side of the binary operator.</param>
internal BinaryFormula(Formula leftOperand, BinaryOperator binaryOperator, Formula rightOperand)
{
Requires.NotNull(leftOperand, nameof(leftOperand));
Requires.InRange(binaryOperator, nameof(binaryOperator));
Requires.NotNull(rightOperand, nameof(rightOperand));
LeftOperand = leftOperand;
Operator = binaryOperator;
RightOperand = rightOperand;
}
示例13: Find
public static IPersistentClassInfo Find(Session session, string referenceTypeFullName)
{
const IPersistentClassInfo persistentClassInfo = null;
string propertyName = persistentClassInfo.GetPropertyName(x => x.PersistentAssemblyInfo) + "." + persistentClassInfo.GetPropertyName(x => x.PersistentAssemblyInfo.Name);
var binaryOperator = new BinaryOperator(propertyName, referenceTypeFullName.Substring(0,referenceTypeFullName.IndexOf(".")));
var operands = new BinaryOperator(persistentClassInfo.GetPropertyName(x=>x.Name),referenceTypeFullName.Substring(referenceTypeFullName.IndexOf(".")+1));
return session.FindObject(PersistentCriteriaEvaluationBehavior.InTransaction, WCTypesInfo.Instance.FindBussinessObjectType<IPersistentClassInfo>(), new GroupOperator(binaryOperator, operands)) as IPersistentClassInfo;
}
示例14: Create
protected override BinaryExpressionBase<BinaryOperator> Create(Expression left, BinaryOperator op, Expression right)
{
if (!(left is AttributeBinaryExpression && right is AttributeBinaryExpression))
{
throw new ArgumentException("Both parameter 'left' and parameter 'right' " +
"must be a AttributeBinaryExpression instance.");
}
return new AttributesPredicateExpression(left as AttributeBinaryExpression, op, right as AttributeBinaryExpression);
}
示例15: FormatBinaryOperator
private void FormatBinaryOperator(BinaryOperator op, bool withParenthesis)
{
operators.Push(op);
if (withParenthesis) { _resultBuilder.Append("("); }
op.LeftOperand.Accept(this);
_resultBuilder.AppendFormat(op.ToString());
op.RightOperand.Accept(this);
if (withParenthesis) { _resultBuilder.Append(")"); }
operators.Pop();
}