Exemple #1
0
 //----< get directory from repostorage >-------
 private void getDir(RepoStorage RS, string dir)
 {
     if (RS.Dir_ == dir)
     {
         RS_ = RS;
         return;
     }
     foreach (RepoStorage child in RS.subDirs_)
     {
         getDir(child, dir);
     }
 }
Exemple #2
0
        //----< show files is selected directory >-------
        private void DirList_MouseDoubleClick(object sender, MouseButtonEventArgs e)
        {
            string selectedDir = (string)DirList.SelectedItem;

            if (DirList.SelectedIndex != -1)
            {
                if (selectedDir == "..")
                {
                    if (pathStack_.Count > 1)
                    {
                        pathStack_.Pop();
                        setPath();
                        RS_ = pathStack_.Peek();
                    }
                    else
                    {
                        return;
                    }
                }
                else
                {
                    pathStack_.Push(RS_.subDirs_[DirList.SelectedIndex - 1]);
                    RS_ = RS_.subDirs_[DirList.SelectedIndex - 1];
                    setPath();
                }
                clearDirs();
                foreach (var dir in RS_.subDirs_)
                {
                    addDir(dir.Dir_);
                }
                insertParent();
                clearFiles();
                foreach (var file in RS_.files_)
                {
                    addFile(file);
                }
            }
        }
Exemple #3
0
 //----< constructor to initialize window >-------
 public AddChildren(RepoStorage RS)
 {
     InitializeComponent();
     RS_ = RS;
 }