示例#1
0
		/// <summary>
		/// 
		/// </summary>
		/// <param name="TemplateString"></param>
		/// <returns></returns>
		async protected Task<Type> GetTemplateCodeTypeByStringAsync(String TemplateString)
		{
			var TemplateCodeGen = new TemplateCodeGen(TemplateString, this);
			TemplateCodeGen.OutputGeneratedCode = OutputGeneratedCode;

			Exception YieldedException = null;

			var Value = await Task.Run(() =>
			{
				try
				{
					return TemplateCodeGen.GetTemplateCodeType();
				}
				catch (Exception Exception)
				{
					YieldedException = Exception;
					return null;
				}
			});

			if (YieldedException != null) throw YieldedException;

			return Value;
			//return new TemplateCodeGenRoslyn(TemplateString, this).GetTemplateCodeType();
		}
示例#2
0
		protected Type GetTemplateCodeTypeByString(String TemplateString)
		{
			var TemplateCodeGen = new TemplateCodeGen(TemplateString, this);
			TemplateCodeGen.OutputGeneratedCode = OutputGeneratedCode;

			return TemplateCodeGen.GetTemplateCodeType();
			//return new TemplateCodeGenRoslyn(TemplateString, this).GetTemplateCodeType();
		}
示例#3
0
        protected Type GetTemplateCodeTypeByString(String TemplateString)
        {
            var TemplateCodeGen = new TemplateCodeGen(TemplateString, this);

            TemplateCodeGen.OutputGeneratedCode = OutputGeneratedCode;

            return(TemplateCodeGen.GetTemplateCodeType());
            //return new TemplateCodeGenRoslyn(TemplateString, this).GetTemplateCodeType();
        }
示例#4
0
		protected static TemplateCode CompileTemplateCodeByString(String Code) {
			var TemplateCodeGen = new TemplateCodeGen(Code);
			TemplateCodeGen.OutputGeneratedCode = true;
			return TemplateCodeGen.GetTemplateCode();
		}