コード例 #1
0
        public void RefreshListView(string path)
        {
            SftpFile[] files = SSHController.PollListInDirectory(path);
            if (files == null)
            {
                return;
            }

            label_listView.Content = path;
            RefreshListView(files);
        }
コード例 #2
0
        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;
                }
            }
        }
コード例 #3
0
        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);
        }