public void RefreshListView(string path) { SftpFile[] files = SSHController.PollListInDirectory(path); if (files == null) { return; } label_listView.Content = path; RefreshListView(files); }
void loadDirectory() { SftpFile[] files; // path 가 null 이라면 부모 files = SSHController.PollListInDirectory(this.path); if (files == null) { this.IsExpanded = false; return; } this.Items.Clear(); Cofile.current.RefreshListView(files); int count_have_directory = 0; foreach (var file in files) { int i; for (i = 0; i < IGNORE_FILENAME.Length; i++) { if (file.Name == IGNORE_FILENAME[i]) { break; } } if (i != IGNORE_FILENAME.Length) { continue; } LinuxTreeViewItem ltvi; if (file.IsDirectory) { //this.Items.Insert(0, new LinuxTreeViewItem(file.FullName, file.Name, true)); //this.Items.Add(new LinuxTreeViewItem(file.FullName, file.Name, true)); ltvi = new LinuxTreeViewItem(file.FullName, file.Name, true); this.Items.Insert(count_have_directory++, ltvi); } else { //this.Items.Insert(0, new LinuxTreeViewItem(file.FullName, file.Name, false)); ltvi = new LinuxTreeViewItem(file.FullName, file.Name, false); this.Items.Add(ltvi); //if(file.Name.Substring(file.Name.Length - test_filter.Length, test_filter.Length) != test_filter) // ltvi.Visibility = Visibility.Collapsed; } } }
private bool LoadChild() { if (!IsLoaded) { return(true); } SftpFile[] files; // path 가 null 이라면 부모 files = SSHController.PollListInDirectory(fileinfo.FullName); if (files == null) { return(false); } this.Childs.Clear(); foreach (var file in files) { this.Childs.Add(new LinuxDirectoryTree(file)); } IsLoaded = true; return(true); }