public static DefaultItem GetDefault(string name) { DefaultItem temp = new DefaultItem(); XDom.Bind(temp, __Config[name]["Default"].OuterText); return(temp); }
public static Templet getTempletByFile(string file) { var opsXml = File.ReadAllText(Config.DIR_TEMPLET + "/" + file, UTF8Encoding.UTF8); Templet temp = new Templet(); XDom.Bind(temp, opsXml); return(temp); }
static SourceConfig() { __Config = new Dictionary <string, XDom>(); foreach (var f1 in Directory.GetFiles(Config.DIR_BUILDER)) { var temp = XDom.Load(f1); var name = Path.GetFileName(f1).Replace(".xml", ""); __Config.Add(name, temp); } }
public static ObjectItem GetObject(string name, DbContextEx db) { ObjectItem temp = new ObjectItem(); string opsXml = __Config[name]["Object"].OuterText; if (opsXml.IndexOf("{db}") > 0) { opsXml = opsXml.Replace("{db}", db.getSchema()); } XDom.Bind(temp, opsXml); return(temp); }
public static PropertyItem GetProperty(string name, DbContextEx db) { PropertyItem temp = new PropertyItem(); string opsXml = __Config[name]["Property"].OuterText; if (opsXml.IndexOf("{db}") > 0) { opsXml = opsXml.Replace("{db}", db.getSchema()); } XDom.Bind(temp, opsXml); if (temp.View.Trim().IndexOf(" ") < 0) { temp.View = temp.Table; } return(temp); }