예제 #1
0
 /// <summary>
 /// 设置方向
 /// </summary>
 /// <param name="rule"></param>
 /// <param name="index"></param>
 public bool SetDirectionRule(DirectionRule rule, string key = null)
 {
     if (string.IsNullOrEmpty(key))
     {
         ForEach((x) =>
         {
             SetDirectionRuleInternal(rule, x);
         });
         return(true);
     }
     else
     {
         TagBehaiver item;
         bool        contain = tagbehavierDic.TryGetValue(key, out item);
         if (contain && item != null)
         {
             SetDirectionRuleInternal(rule, item);
             return(true);
         }
         else
         {
             return(false);
         }
     }
 }
예제 #2
0
 private void SetDirectionRuleInternal(DirectionRule rule, TagBehaiver behaiver)
 {
     if (behaiver == null)
     {
         return;
     }
     behaiver.directionRule = rule;
 }