Beispiel #1
0
        async public void SetSelectedNode(string path)
        {
            var fileAttributes = File.GetAttributes(path);
            var isDirectory    =
                fileAttributes.HasFlag(FileAttributes.Directory);

            if (isDirectory)
            {
                SelectedNode = new DirectoryViewModel(path);
                FileContent  = "";
            }
            else
            {
                SelectedNode = new FileViewModel(path);
                var streamReader = new StreamReader(path);
                FileContent = await streamReader.ReadToEndAsync();

                streamReader.Close();
            }
        }
Beispiel #2
0
 public void SetRoot(string path)
 {
     root = fileManagerService.SetRoot(path);
 }
Beispiel #3
0
 public void SetRoot()
 {
     root = fileManagerService.GetRootFromUser();
 }