public override void AbstractOpen() { var currentDirInfo = new DirectoryInfo(AbstractPath); foreach (var item in currentDirInfo.GetFiles()) { var newFile = new File(Path.Combine(AbstractPath, item.Name)); FilesList.Add(newFile); } foreach (var item in currentDirInfo.GetDirectories()) { var newDirectory = new Folder(Path.Combine(AbstractPath, item.Name)); DirectoriesList.Add(newDirectory); } }
private void Copy_Click(object sender, EventArgs e) { foreach (var item in LeftKontrol.ActiveDirectory.DirectoriesList.Where(item => item.AbstractName == LeftKontrol.ClickItem)) { AbstractFolder CopiedItem = new Folder(RightKontrol.ActiveDirectory.AbstractPath + @"\" + LeftKontrol.ClickItem); foreach (var progressInfo in item.AbstractCopy(CopiedItem)) { pgsCopy.Maximum = progressInfo.All; pgsCopy.Value = progressInfo.Current; } break; } foreach (var item in LeftKontrol.ActiveDirectory.FilesList.Where(item => item.AbstractName == LeftKontrol.ClickItem)) { AbstractFile CopiedItem = new File(RightKontrol.ActiveDirectory.AbstractPath + @"\" + LeftKontrol.ClickItem); item.AbstractCopy(CopiedItem); break; } KontrolsUpdates(); pgsCopy.Value = 0; }
private void ReplaceRight_Click(object sender, EventArgs e) { foreach (var item in RightKontrol.ActiveDirectory.DirectoriesList.Where(item => item.AbstractName == RightKontrol.ClickItem)) { var folderToReplace = new Folder(LeftKontrol.ActiveDirectory.AbstractPath + @"\" + item.AbstractName); item.AbstractReplace(folderToReplace); } foreach (var item in RightKontrol.ActiveDirectory.FilesList.Where(item => item.AbstractName == RightKontrol.ClickItem)) { var fileToReplace = new Folder(LeftKontrol.ActiveDirectory.AbstractPath); item.AbstractReplace(fileToReplace); } KontrolsUpdates(); }