internal static List <MvdPropertyRuleValue> GetValues(string _s) { List <MvdPropertyRuleValue> vals = new List <MvdPropertyRuleValue>(); var parts = _s.Split(new[] { " AND ", ";" }, StringSplitOptions.RemoveEmptyEntries); Regex re = new Regex(@"(?<varName>.+?)(\[(?<varProp>.*)])*='(?<varVal>.*)'"); Regex re2 = new Regex(@"(?<varName>.+?)(\[(?<varProp>.*)])*=(?<varVal>.*)"); foreach (var part in parts) { var v = re.Match(part.Trim()); var v2 = re2.Match(part.Trim()); if (v.Success) { MvdPropertyRuleValue rv = new MvdPropertyRuleValue( v.Groups["varName"].Value, v.Groups["varProp"].Value, v.Groups["varVal"].Value ); vals.Add(rv); } else if (v2.Success) { MvdPropertyRuleValue rv = new MvdPropertyRuleValue( v.Groups["varName"].Value, "Value", v.Groups["varVal"].Value ); vals.Add(rv); } } return(vals); }
internal IEnumerable <MvdPropertyRuleValue> ParValues() { List <MvdPropertyRuleValue> vals = MvdPropertyRuleValue.GetValues(_s); return(vals); }
internal IEnumerable <string> ParameterNames() { List <MvdPropertyRuleValue> vals = MvdPropertyRuleValue.GetValues(_s); return(vals.Select(x => x.Name)); }