예제 #1
0
파일: TestCodgen.cs 프로젝트: mind0n/hive
        public static void Run()
        {
            CodgenXml cx   = new CodgenXml();
            string    path = "CodgenTemplates/CSharp/ClassBuilder/ClassBuilder.xml";

            Console.WriteLine(cx.ReadFile(path));
        }
예제 #2
0
파일: CodgenCore.cs 프로젝트: mind0n/hive
        public static string Run(string fullFileName)
        {
            string    rlt;
            CodgenXml cx = new CodgenXml(Assembly.GetCallingAssembly());

            rlt = cx.ReadFile(fullFileName);
            return(rlt);
        }
예제 #3
0
파일: CodgenCore.cs 프로젝트: mind0n/hive
        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);
        }
예제 #4
0
파일: CodgenCore.cs 프로젝트: mind0n/hive
		public static string Run(string fullFileName)
		{
			string rlt;
			CodgenXml cx = new CodgenXml(Assembly.GetCallingAssembly());
			rlt = cx.ReadFile(fullFileName);
			return rlt;
		}
예제 #5
0
파일: CodgenCore.cs 프로젝트: mind0n/hive
		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;
		}
예제 #6
0
파일: TestCodgen.cs 프로젝트: mind0n/hive
		public static void Run()
		{
			CodgenXml cx = new CodgenXml();
			string path = "CodgenTemplates/CSharp/ClassBuilder/ClassBuilder.xml";
			Console.WriteLine(cx.ReadFile(path));
		}