本文整理汇总了C#中Rule.copyBinding方法的典型用法代码示例。如果您正苦于以下问题:C# Rule.copyBinding方法的具体用法?C# Rule.copyBinding怎么用?C# Rule.copyBinding使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Rule
的用法示例。
在下文中一共展示了Rule.copyBinding方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: getBindings
/// <summary> the paramList should be clean and
/// other codes surrounding this method in subclass may be removed into this method.
/// Houzhanbin 10/16/2007
/// </summary>
/// <param name="">condition
/// </param>
/// <param name="">rule
/// </param>
/// <param name="">Constraints
/// </param>
/// <param name="">position
/// </param>
/// <param name="">hasNotEqual
/// </param>
/// <param name="">hasPredicateJoin
/// </param>
/// <returns>
///
/// </returns>
internal Binding[] getBindings(ICondition condition, Rule.IRule rule, int position)
{
ObjectCondition oc = getObjectCondition(condition);
IList Constraints = oc.BindConstraints;
Deftemplate tmpl = oc.Deftemplate;
Binding[] binds = new Binding[Constraints.Count];
for (int idz = 0; idz < Constraints.Count; idz++)
{
Object cst = Constraints[idz];
if (cst is BoundConstraint)
{
BoundConstraint bc = (BoundConstraint) cst;
Binding cpy = rule.copyBinding(bc.VariableName);
if (cpy.LeftRow >= position)
{
binds = new Binding[0];
break;
}
else
{
binds[idz] = cpy;
int rinx = tmpl.getColumnIndex(bc.Name);
// we increment the count to make sure the
// template isn't removed if it is being used
tmpl.incrementColumnUseCount(bc.Name);
binds[idz].RightIndex = rinx;
binds[idz].Negated = bc.Negated;
if (bc.Negated)
{
oc.HasNotEqual = true;
}
}
}
else if (cst is PredicateConstraint)
{
PredicateConstraint pc = (PredicateConstraint) cst;
if (pc.Value is BoundParam)
{
oc.HasPredicateJoin = true;
BoundParam bpm = (BoundParam) pc.Value;
String var = bpm.VariableName;
int op = ConversionUtils.getOperatorCode(pc.FunctionName);
// check and make sure the function isn't user defined
if (op != Constants.USERDEFINED)
{
// if the first binding in the function is from the object type
// we reverse the operator
if (pc.Parameters[0] != bpm)
op = ConversionUtils.getOppositeOperatorCode(op);
binds[idz] = rule.copyPredicateBinding(var, op);
((Binding2) binds[idz]).RightVariable = pc.VariableName;
}
else
{
binds[idz] = rule.copyPredicateBinding(var, op);
}
binds[idz].PredJoin = true;
int rinx = tmpl.getColumnIndex(pc.Name);
// we increment the count to make sure the
// template isn't removed if it is being used
tmpl.incrementColumnUseCount(pc.Name);
binds[idz].RightIndex = rinx;
}
else if (pc.Value is FunctionParam)
{
// this means there is a nested function
}
}
}
return binds;
}