Example #1
0
        /// <summary>
        /// 创建CSharp代码生成器
        /// </summary>
        /// <param name="type">模板数据视图</param>
        /// <param name="auto">安装属性</param>
        /// <returns>生成器代码</returns>
        private static string createClass(Type type, auto auto)
        {
            coder code = new coder(type);

            code.skin(getNode(auto.GetFileName(type)));
            return(code.partCodes["CLASS"]);
        }
Example #2
0
                /// <summary>
                /// 生成类定义字符串
                /// </summary>
                /// <returns>类定义字符串</returns>
                public override string ToString()
                {
                    cSharp.cSharper.definition definition = new cSharp.cSharper.definition(Type, true, true);
                    coder code = new coder(Type);

                    code.skin(getNode(Auto.GetFileName(Type)));
                    return(@"
" + definition.Start + @"
        /// <summary>
        /// 生成代码
        /// </summary>
        /// <param name=""isOut"">是否输出代码</param>
        protected override void create(bool isOut)
        {
            fastCSharp.setup.cSharp.cSharper.definition definition = isOut ? outStart() : null;
            if (!isOut || definition != null)
            {
                " + code.partCodes["CLASS"] + @"
                outEnd(definition);
            }
        }" + definition.End);
                }