Ejemplo n.º 1
0
        public DynamicInstance QueryInstance()
        {
            DynamicInstance res = new DynamicInstance(this);

            if (!Empty)
            {
                if (!EditPropertiesForm.Run(res, true))
                {
                    return(null);
                }
            }
            return(res);
        }
Ejemplo n.º 2
0
        public DynamicInstance CreateParamsInstance()
        {
            DynamicClass cls       = new DynamicClass();
            var          defvalues = new Dictionary <string, string>();

            foreach (MacroVariable var in Variables)
            {
                var d = new DynamicAttribute();
                d.Description = String.Format("{0}; {1}:{2}", var.VarType, Texts.Get("s_variable"), var.VarName);
                d.Name        = var.VarName;
                d.Title       = var.VarType != null ? var.VarType : "(" + var.DefValue + ")";
                cls.Attributes.Add(d);
                defvalues[var.VarName] = var.DefValue;
            }
            DynamicInstance res = cls.CreateInstance();

            foreach (string key in defvalues.Keys)
            {
                res.Data[key] = defvalues[key];
            }
            return(res);
        }