Ejemplo n.º 1
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="dir"></param>
        /// <param name="result"></param>
        private void GetAllFiles(string dir, IDictionary <UpdateDirInfo, List <UpdateFileInfo> > result)
        {
            var files   = new List <UpdateFileInfo>();
            var dirInfo = new UpdateDirInfo(dir, _rootDir);

            ;

            var tmpFiles = Directory.GetFiles(dir);

            foreach (string file in tmpFiles)
            {
                if (_threadArgs.ExcludeInfo.Files.Contains(file))
                {
                    continue;
                }
                OnXmlCreateProgress(
                    new XmlCreateProgressArgs
                {
                    ProgressType = CreateTyep.CreateInfo,
                    Msg          = "正在分析 " + file.Substring(file.LastIndexOf("\\") + 1),
                    Complete     = false,
                    FileCount    = _createFileCount,
                    Progress     = 0
                });

                _createFileCount++;

                files.Add(new UpdateFileInfo(file));
            }

            result.Add(dirInfo, files);

            foreach (string item in Directory.GetDirectories(dir))
            {
                GetAllFiles(item, result);
            }
        }
Ejemplo n.º 2
0
        /// <summary>
        /// 
        /// </summary>
        /// <param name="dir"></param>
        /// <param name="result"></param>
        private void GetAllFiles(string dir, IDictionary<UpdateDirInfo, List<UpdateFileInfo>> result)
        {
            var files = new List<UpdateFileInfo>();
            var dirInfo = new UpdateDirInfo(dir, _rootDir);
            ;

            var tmpFiles = Directory.GetFiles(dir);
            foreach (string file in tmpFiles)
            {
                if (_threadArgs.ExcludeInfo.Files.Contains(file)) continue;
                OnXmlCreateProgress(
                    new XmlCreateProgressArgs
                        {
                            ProgressType = CreateTyep.CreateInfo,
                            Msg = "正在分析 " + file.Substring(file.LastIndexOf("\\") + 1),
                            Complete = false,
                            FileCount = _createFileCount,
                            Progress = 0
                        });

                _createFileCount++;

                files.Add(new UpdateFileInfo(file));
            }

            result.Add(dirInfo, files);

            foreach (string item in Directory.GetDirectories(dir))
            {
                GetAllFiles(item, result);
            }
        }