protected MinifierServiceBase(string basePath,
                               GenerateFileDelegate<IEnumerable<FileInfo>, string> action,
                               params string[] extensions) {
     if (extensions == null) throw new ArgumentNullException("extensions");
     _basePath = basePath;
     _generate = action;
     _fileExtensions = extensions;
 }
Ejemplo n.º 2
0
 public static void AddFileGenerator(GenerateFileDelegate generator)
 {
     lock (FileGenerators)
         FileGenerators.Add("", generator);
 }
Ejemplo n.º 3
0
 public static void AddFileGenerator(string subPath, GenerateFileDelegate generator)
 {
     lock (FileGenerators)
         FileGenerators.Add(subPath, generator);
 }
Ejemplo n.º 4
0
        public override bool CreateFiles(ref string msg, string saveDir, List <TableMeta> tables, GenerateFileDelegate generateFileFunc, UIVOBase vo)
        {
            msg = string.Empty;
            UIVO viewModel = vo as UIVO;

            for (int i = 0; i < tables.Count; i++)
            {
                vo.CurrentTable = tables[i];
                string file = Path.Combine(saveDir, viewModel.ClassPre + vo.CurrentTable.UpperCamelName + ".cs");

                if (!generateFileFunc(file, TEMPLATE_NAME, typeof(UIVO), viewModel))
                {
                    continue;
                }
            }

            return(true);
        }
Ejemplo n.º 5
0
 /// <summary>
 /// 生成文件
 /// </summary>
 /// <param name="msg"></param>
 /// <param name="generateFileFunc"></param>
 /// <param name="vo"></param>
 /// <returns></returns>
 public abstract bool CreateFiles(ref string msg, String saveDir, List <TableMeta> tables, GenerateFileDelegate generateFileFunc, UIVOBase vo);