Beispiel #1
0
        public static DefaultItem GetDefault(string name)
        {
            DefaultItem temp = new DefaultItem();

            XDom.Bind(temp, __Config[name]["Default"].OuterText);

            return(temp);
        }
Beispiel #2
0
        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);
        }
Beispiel #3
0
        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);
            }
        }
Beispiel #4
0
        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);
        }
Beispiel #5
0
        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);
        }