当前位置: 首页>>代码示例>>C#>>正文


C# Rule.copyBinding方法代码示例

本文整理汇总了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;
 }
开发者ID:,项目名称:,代码行数:90,代码来源:


注:本文中的Rule.copyBinding方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。