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); }
public DynamicInstancePropertyDescriptor(DynamicAttribute attrib) : base(attrib.Name, new Attribute[] { }) { m_attrib = attrib; }