Exemplo n.º 1
0
 /// <summary>
 /// 文件列表刷新(不修改地址列表)
 /// </summary>
 public static void flist_flash()
 {
     fList = new List <mc_FolderInfoType>();
     foreach (string path_str in pList)                      //遍历地址列表
     {
         DirectoryInfo    dir = new DirectoryInfo(path_str); //新建字典信息变量
         FileSystemInfo[] f;
         try
         {
             f = dir.GetFileSystemInfos();   //读取文件信息
             foreach (FileSystemInfo i in f) //遍历文件
             {
                 if (i is DirectoryInfo)     //如果为文件夹
                 {
                     FileInfo fin     = new FileInfo(i.FullName);
                     string   tmp_str = pList.Find(s => s == path_str + @"\" + fin.Name);
                     if (string.IsNullOrEmpty(tmp_str))
                     {
                         mc_FolderInfoType tmp_FIT = new mc_FolderInfoType();
                         tmp_FIT.Name         = fin.Name;
                         tmp_FIT.Path         = path_str;// + @"\";
                         tmp_FIT.CreationTime = fin.CreationTime.ToString(@"yyyy/MM/dd");
                         tmp_FIT.EditTime     = fin.LastWriteTime.ToString(@"yyyy/MM/dd");
                         tmp_FIT.PD           = mscCtrl.getPD(path_str + @"\" + fin.Name + @"\foldersPD.xml");
                         fList.Add(tmp_FIT);
                     }
                 }
             }
             search();
         }
         catch
         {
             f = null;
         }
     }
 }
Exemplo n.º 2
0
        /// <summary>
        /// search中lambda表达式委托函数
        /// </summary>
        /// <param name="tmp_FIT">文件夹信息类型</param>
        /// <param name="tmp_arr">检索关键词数组</param>
        /// <returns>包含所有关键词返回true否则为false</returns>
        static bool flag(mc_FolderInfoType tmp_FIT)
        {
            TimeSpan ts = DateTime.Now - DateTime.Parse(tmp_FIT.EditTime);

            if ((ts.Days > timeFilter * 30) && (timeFilter > 0))
            {
                return(false);
            }
            string tStr4Search = tmp_FIT.Name;

            if (tmp_FIT.PD != null)
            {
                tStr4Search += Environment.NewLine + tmp_FIT.PD.StringForSearch;
            }

            foreach (string c in cList)
            {
                if (tStr4Search.IndexOf(c) < 0)
                {
                    return(false);
                }
            }
            return(true);
        }
Exemplo n.º 3
0
        public static void updatePD(ProjectDetails pPD, string pPath)
        {
            mc_FolderInfoType tmFIT = fList.Find(t => t.Path + t.Name == pPath);

            tmFIT.PD = pPD;
        }