public void Variables(VariablesPart variables) { if (mActions.isMenuContext) { string vname = "gxuiButtonCollection"; if (variables.GetVariable(vname) == null) { Variable var = new Variable(variables); var.Name = vname; DataType.ParseInto(mActions.Parent.Instance.Model, "gxuiButton", var); var.IsCollection = true; variables.Variables.Add(var); } vname = "gxuiButton"; if (variables.GetVariable(vname) == null) { Variable var = new Variable(variables); var.Name = vname; DataType.ParseInto(mActions.Parent.Instance.Model, "gxuiButton", var); variables.Variables.Add(var); } } }
private static Variable AddVariable(VariablesPart variables, string name) { if (variables.GetVariable(name) == null) { Variable var = new Variable(variables); var.Name = name; variables.Variables.Add(var); return var; } return null; }
internal static Variable getVariable(VariablesPart obj, string nome, out bool IsNovo) { if (nome.StartsWith("&")) nome = nome.Substring(1); Variable var = obj.GetVariable(nome); if (var == null) { IsNovo = true; var = new Variable(obj); var.Name = nome; obj.Variables.Add(var); } else { IsNovo = false; if (var.Name != nome) var.Name = nome; } return var; }