public static void Run() { CodgenXml cx = new CodgenXml(); string path = "CodgenTemplates/CSharp/ClassBuilder/ClassBuilder.xml"; Console.WriteLine(cx.ReadFile(path)); }
public static string Run(string fullFileName) { string rlt; CodgenXml cx = new CodgenXml(Assembly.GetCallingAssembly()); rlt = cx.ReadFile(fullFileName); return(rlt); }
protected string ParseElement(XmlReader xr) { string elName, rlt = ""; elName = xr.Name.ToLower(); if (elName.Equals("import")) { string url = XmlReaderHelper.ReadAttribute(xr, "Url"); if (!string.IsNullOrEmpty(url) && url.IndexOf(':') < 0) { url = BaseDir + url; } CodgenXml cx = new CodgenXml(CallingAssembly); foreach (CodgenParam cp in Params) { if (cp.ParamType.Equals("globalreplace")) { CodgenParam ncp = new CodgenParam(cp.Key, cp.Value, cp.ParamType); cx.Params.Add(ncp); } } rlt = cx.ReadFile(url); } else if (elName.Equals("contentreplace")) { string key = XmlReaderHelper.ReadAttribute(xr, "Handler"); string scope = XmlReaderHelper.ReadAttribute(xr, "Scope"); string val = XmlReaderHelper.ReadContent(xr); if (string.IsNullOrEmpty(scope)) { scope = "replace"; } CodgenParam par = new CodgenParam(key, val, scope.ToLower()); Params.Add(par); //xr.Read(); //xr.Read(); } else { XmlReaderHelper.EnumAttributes(xr, delegate(string k, string v, string n) { CodgenParam par; par = new CodgenParam(k, v, n); Params.Add(par); }); } return(rlt); }
public static string Run(string fullFileName) { string rlt; CodgenXml cx = new CodgenXml(Assembly.GetCallingAssembly()); rlt = cx.ReadFile(fullFileName); return rlt; }
protected string ParseElement(XmlReader xr) { string elName, rlt = ""; elName = xr.Name.ToLower(); if (elName.Equals("import")) { string url = XmlReaderHelper.ReadAttribute(xr, "Url"); if (!string.IsNullOrEmpty(url) && url.IndexOf(':') < 0) { url = BaseDir + url; } CodgenXml cx = new CodgenXml(CallingAssembly); foreach (CodgenParam cp in Params) { if (cp.ParamType.Equals("globalreplace")) { CodgenParam ncp = new CodgenParam(cp.Key, cp.Value, cp.ParamType); cx.Params.Add(ncp); } } rlt = cx.ReadFile(url); } else if (elName.Equals("contentreplace")) { string key = XmlReaderHelper.ReadAttribute(xr, "Handler"); string scope = XmlReaderHelper.ReadAttribute(xr, "Scope"); string val = XmlReaderHelper.ReadContent(xr); if (string.IsNullOrEmpty(scope)) { scope = "replace"; } CodgenParam par = new CodgenParam(key, val, scope.ToLower()); Params.Add(par); //xr.Read(); //xr.Read(); } else { XmlReaderHelper.EnumAttributes(xr, delegate(string k, string v, string n) { CodgenParam par; par = new CodgenParam(k, v, n); Params.Add(par); }); } return rlt; }