Exemple #1
0
        public static PropertyValueAction[] ParseToArray(string s)
        {
            //s = v,p1=v1,p2=v2;v3
            List <PropertyValueAction> propactions = new List <PropertyValueAction>();

            string[] parts = s.Split(';');
            foreach (string p in parts)
            {
                PropertyValueAction propertyValueAction = PropertyValueAction.Parse(p);
                if (propertyValueAction != null)
                {
                    propactions.Add(propertyValueAction);
                }
            }
            return(propactions.ToArray());
        }
Exemple #2
0
 // value,property1=value1,property2=value2
 public static PropertyValueAction Parse(string s)
 {
     s = s.Trim();
     string[] parts = s.Split(',');
     if (parts.Length > 0)
     {
         PropertyValueAction propaction = new PropertyValueAction();
         propaction.value = parts[0];
         List <DefineableAction> actions = new List <DefineableAction>();
         for (int i = 1; i < parts.Length; i++)
         {
             actions.Add(DefineableAction.Parse(parts[i]));
         }
         propaction.actions = actions.ToArray();
         return(propaction);
     }
     return(null);
 }
Exemple #3
0
 private PropertyOptions ExtractExtraOptionsFromDisplayName(ref string displayName)
 {
     if (displayName.Contains(EXTRA_OPTIONS_PREFIX))
     {
         string[] parts = displayName.Split(new string[] { EXTRA_OPTIONS_PREFIX }, 2, System.StringSplitOptions.None);
         displayName = parts[0];
         PropertyOptions options = Parser.ParseToObject <PropertyOptions>(parts[1]);
         if (options != null)
         {
             if (options.condition_showS != null)
             {
                 options.condition_show = DefineableCondition.Parse(options.condition_showS);
             }
             if (options.on_value != null)
             {
                 options.on_value_actions = PropertyValueAction.ParseToArray(options.on_value);
             }
             return(options);
         }
     }
     return(new PropertyOptions());
 }