Esempio n. 1
0
 private void SetCountFiles(FileInfo[] files)
 {
     this.less   += files.Where(file => file.Length / 1024 < 10000).Count();
     this.middle += files.Where(file => file.Length / 1024 >= 10000 && file.Length / 1024 <= 50000).Count();
     this.more   += files.Where(file => file.Length / 1024 > 100000).Count();
     FileCountModels.SetCount(less, middle, more);
 }
Esempio n. 2
0
        public void FileFolderInitializer(List <FolderModels> folders, List <FileModels> files)
        {
            string getParentPath = folders.Select(root => root.ParentPath).FirstOrDefault();

            try {
                GetCurrentPath = folders.Select(root => root.CurrentPath).FirstOrDefault().ToString();
                if (getParentPath == GetCurrentPath)
                {
                    GetParentPath = "none";
                }
                else
                {
                    GetParentPath = getParentPath;
                }
            }
            catch (NullReferenceException ex)
            {
                ExceptionProcessing.ErrorWriting(ex.Message);
            }

            _getFolders = folders;
            _getFiles   = files.Where(path => path.PathName == GetCurrentPath).ToList();

            GetCount = FileCountModels.GetCount();
        }
Esempio n. 3
0
        public void LogicalDrivesInitializer(string driveName, List <FileModels> files)
        {
            GetCurrentPath = "My computer";
            GetParentPath  = "none";

            _getFolders.Add(new FolderModels
            {
                CurrentPath = new DirectoryInfo("My computer"),
                PathName    = driveName
            });
            _getFiles = files.Where(path => path.PathName == driveName).ToList();
            GetCount  = FileCountModels.GetCount();

            /*FileCountModels count = GetFilesCount(files);
             * GetCount.FileLenghtLess += count.FileLenghtLess;
             * GetCount.FileLenghtMiddle += count.FileLenghtMiddle;
             * GetCount.FileLenghtMore += count.FileLenghtMore;
             */
        }