public IEnumerable <ClassFile> GetGivenTypes(Task task) { IEnumerable <FileInfo> allFiles = new FolderContents(task) .GetAllGivenTypes(); return(ClassFiles(allFiles)); }
private void ResetInternals() { this.CurrentPackageFullName = null; this.currentFolderName = null; this.currentFolderContents = null; this.currentAppPackages = null; this.PackageSelector.Items.Clear(); this.FileList.Items.Clear(); }
public void TestGetAllTests() { new FolderContents(Task).GetAllTests(); string path = Path.Combine(Directory.GetCurrentDirectory(), Tasks, TaskName, Tests); CreateFileIn(path); IEnumerable <FileInfo> allTests = new FolderContents(Task).GetAllTests(); Assert.IsTrue(allTests.Any(file => file.Name.Equals(TestFile))); }
public void TestGetAllSolutionFiles() { DirectoryInfo directoryInfo = SolutionFolder(); CreateFileIn(directoryInfo.FullName); IEnumerable <FileInfo> allSolutionFiles = new FolderContents(Task) .GetAllSolutionFiles(Solution); Assert.IsTrue(allSolutionFiles.Any(file => file.Name.Equals(TestFile))); }
private static string FilePath(Solution solution, string fileName) { DirectoryInfo solutionFolder = new FolderContents(solution.Task) .SolutionFolder(solution); string filePath = Path.Combine( solutionFolder.FullName, fileName.TrimStart('/')); return(filePath); }
private async void FillListFiles() { this.FileList.Items.Clear(); try { this.currentFolderContents = await this.portal.GetFolderContentsAsync("LocalAppData", this.currentFolderName, this.CurrentPackageFullName); this.FileList.Items.Add(".."); for (int i = 0; i < this.currentFolderContents.Contents.Count; i++) { this.FileList.Items.Add(this.currentFolderContents.Contents.ElementAt(i).Name); } this.EnableFileExplorerControls(true); } catch (Exception e) { this.MarshalUpdateCommandOutput("Caught exception: " + e.ToString()); this.EnableFileExplorerControls(false); } }
private void PackageSelector_SelectionChanged(object sender, SelectionChangedEventArgs e) { if (this.PackageSelector.SelectedIndex < 0) { return; } PackageInfo f = this.currentAppPackages.Packages.Find(y => y.Name == this.PackageSelector.SelectedItem.ToString()); if (f != null) { this.CurrentPackageFullName = f.FullName; this.currentFolderContents = null; this.FillListFiles(); } else { this.CurrentPackageFullName = null; this.currentFolderContents = null; this.FileList.Items.Clear(); } }
static void Main(string[] args) { try { FolderContents client = new FolderContents(); Console.WriteLine($"Enter directory\n(example: C:\\Windows ):\n\tor enter exit:"); string path = Console.ReadLine(); while (path != "exit") { var res = client.GetFolderContents(path); foreach (var item in res) { Console.WriteLine(item.ToString()); } Console.WriteLine($"\nEnter directory\n(example: C:\\Windows ):\n\tor enter exit:"); path = Console.ReadLine(); } } catch (Exception ex) { Console.WriteLine(ex.Message); } }
public FolderContents Get(string?path) { path = path ?? "C:/"; Console.WriteLine($"requesting contents of: {path}"); return(FolderContents.Scan(path)); }
public QuickCompareArgs(bool isQuickCompare, FolderContents folder = null) { IsQuickCompare = isQuickCompare; Folder = folder; }
public MainViewModelArgs(IDialogService dialogService, AppSettings settings, FolderContents folder) { DialogService = dialogService; Settings = settings; Folder = folder; }