public static void merge(string strSrcDirPath, string strSubDirName, IMergeImageAdapter oIMergeImageAdapter) { //0.get srcDirPath var strSrcDirPathImg = oIMergeImageAdapter.getSrcDirPathImg(strSrcDirPath, strSubDirName); //1.get all image files var lstImgInDir = new List <FileInfo>(); FileUtils.getFilesInDir(strSrcDirPathImg, IMG_TYPE_PNG, ref lstImgInDir); FileUtils.getFilesInDir(strSrcDirPathImg, IMG_TYPE_CUR, ref lstImgInDir); foreach (var oFileImg in lstImgInDir) { if (!string.IsNullOrEmpty(oIMergeImageAdapter.getIgnoreName())) { if (oFileImg.FullName.Contains(oIMergeImageAdapter.getIgnoreName())) { continue; } } //2.get strDstFilePathImg var strDstFilePathImg = oIMergeImageAdapter.getDstFilePathImg(strSrcDirPath, oFileImg.Name); //3.copy File.Copy(oFileImg.FullName, strDstFilePathImg, true); Console.WriteLine(new FileInfo(strDstFilePathImg).Name); } }
public static void merge(string strSrcDirPath, string strSubDirName, IMergeImageAdapter oIMergeImageAdapter) { //0.get srcDirPath var strSrcDirPathImg = oIMergeImageAdapter.getSrcDirPathImg(strSrcDirPath, strSubDirName); //1.get all image files var lstImgInDir = new List<FileInfo>(); FileUtils.getFilesInDir(strSrcDirPathImg, IMG_TYPE_PNG, ref lstImgInDir); FileUtils.getFilesInDir(strSrcDirPathImg, IMG_TYPE_CUR, ref lstImgInDir); foreach (var oFileImg in lstImgInDir) { if (!string.IsNullOrEmpty(oIMergeImageAdapter.getIgnoreName())) { if (oFileImg.FullName.Contains(oIMergeImageAdapter.getIgnoreName())) { continue; } } //2.get strDstFilePathImg var strDstFilePathImg = oIMergeImageAdapter.getDstFilePathImg(strSrcDirPath, oFileImg.Name); //3.copy File.Copy(oFileImg.FullName, strDstFilePathImg, true); Console.WriteLine(new FileInfo(strDstFilePathImg).Name); } }