예제 #1
0
 public virtual ISelectOrder Parse(string exp)
 {
     if (!StringUtil.IsNullOrEmpty(exp))
     {
         string[] ss = exp.Split(SPLITER_TYPE);
         if (ss.Length == 2)
         {
             FeatureSelectOrder featureOrder = new FeatureSelectOrder();
             featureOrder.SetFeature(ss[0].Trim());
             featureOrder.SetValue(GetOrderValue(ss[1]));
             return(featureOrder);
         }
     }
     throw new ConditionParseException("错误的格式" + exp);
 }
예제 #2
0
        private IList <FeatureSelectOrder> BuildOrder(string features)
        {
            IList <FeatureSelectOrder> orders = new List <FeatureSelectOrder>();

            if (!StringUtil.IsNullOrEmpty(features))
            {
                foreach (string feature in features.Split(SPLITER_FEATURE))
                {
                    string[] ss = feature.Split(SPLITER_TYPE);
                    if (ss.Length == 2)
                    {
                        FeatureSelectOrder featureOrder = new FeatureSelectOrder();
                        featureOrder.SetFeature(ss[0].Trim());
                        featureOrder.SetValue(GetOrderValue(ss[1]));
                        orders.Add(featureOrder);
                    }
                }
            }
            return(orders);
        }