private void AddSelectedFilesIndgList(string[] fileNames) { List <FileSubscriber> list = listFile.ToList(); foreach (string file in fileNames) { FileSubscriber finded = list.Find(f => f.Path == file); if (finded != null) { Dialog.ShowMessage($"Выбранный файл уже контролируется:\n" + $"{fileNames}"); return; } DirFile pathInfo = new DirFile(file); ulong sizeFile = pathInfo.GetFileSize(); FileSubscriber fileChecked = new FileSubscriber() { Checked = true, Path = file, Size = sizeFile, SizeString = pathInfo.GetSizeFormat(sizeFile) }; _subscriber.SubscribeChangeFile(fileChecked); list.Add(fileChecked); } SetItemSouce(list); }
internal void SetCurrentSize() { Size = DirFile.GetFileSize(_path); SizeString = DirFile.GetSizeFormat(_size); }