예제 #1
0
        public static string GetRecycleByPath(string s)
        {
            string name = System.IO.File.Exists(s) ? System.IO.Path.GetFileName(s) : new System.IO.DirectoryInfo(s).Name;
            string dst  = CfgPath.GetRecycleName(name);

            return(dst);
        }
예제 #2
0
 }                                                                        //{ get { return SubDir(DocBasePath, "Recycle"); } }
 public static void MoveToRecycle(string f)
 {
     if (File.Exists(f))
     {
         File.Move(f, CfgPath.GetRecycleByPath(f));
     }
 }
예제 #3
0
        public static string GetTemplateFileByTag(GUTag tag, string dotPostfix)
        {
            string file        = CfgPath.GetFileByTag(tag, "note" + dotPostfix, true);//这儿保证目录创建,并且file不为null
            string tmplateFile = TemplateHelper.GetTemplateByExtension(dotPostfix);

            if (!File.Exists(file) && File.Exists(tmplateFile))
            {
                File.Copy(tmplateFile, file);
            }
            if (File.Exists(file))
            {
                return(file);
            }
            else
            {
                return(null);
            }
        }
예제 #4
0
        public static void MoveToRecycle(IEnumerable <string> Uris)
        {
            List <string> srcs = new List <string>();

            srcs.AddRange(Uris);
            List <string> dstList = new List <string>();
            List <string> srcList = new List <string>();

            foreach (string s in srcs)
            {
                if (PathHelper.IsValidFS(s))
                {
                    string dst = CfgPath.GetRecycleByPath(s);
                    dstList.Add(dst);
                    srcList.Add(s);
                }
            }
            FileShell.SHMoveFiles(srcList.ToArray(), dstList.ToArray());
        }