Esempio n. 1
0
 private void TraverseLoadMovieList(ref DirectoryOrFile _df, ref List <DirectoryOrFile> _list)
 {
     if (_df.Type() == DirectoryOrFile.DOF_Type.FILE)
     {
         // is this a movie?
         int i = 0;
         for (i = 0; i < _knownMovieTypes.Length; i++)
         {
             if (Path.GetExtension(_df.Path()).ToLower().Contains(_knownMovieTypes[i]))
             {
                 break;
             }
         }
         if (i < _knownMovieTypes.Length)
         {
             // this is a movie
             _list.Add(_df);
         }
     }
     else
     {
         for (int i = 0; i < _df.NumChildren(); i++)
         {
             DirectoryOrFile childDf = _df.Child(i);
             TraverseLoadMovieList(ref childDf, ref _list);
         }
     }
 }
Esempio n. 2
0
        //protected void TraverseDirTree(DirectoryOrFile node, int level, ref TreeStore store, TreeIter iter)
        protected void TraverseDirTree(TreeView tv, DirectoryOrFile node, int level, ref IngressTreeNode tree_node) //ref TreeStore store, TreeIter iter)
        {
            IngressTreeNode thisNodeIter = new IngressTreeNode(node.Name(), node);

            if (level == 0)
            {
                tv.Nodes.Add(thisNodeIter); //           store.AppendValues(node.Name());
            }
            else
            {
                tree_node.Nodes.Add(thisNodeIter); // store.AppendValues(iter, node.Name());
            }
            //for (int i = 0; i < level; i++)
            //    Console.Write("   ");
            //Console.WriteLine("{0} = {1} ({2})", node.Name(), node.Path(), node.Type() == DirectoryOrFile.DOF_Type.DIR ? "D" : (node.Type() == DirectoryOrFile.DOF_Type.FILE ? "F" : "U"));

            for (int i = 0; i < node.NumChildren(); i++)
            {
                //TraverseDirTree(node.Child(i), level + 1, ref store, thisNodeIter);
                TraverseDirTree(tv, node.Child(i), level + 1, ref thisNodeIter);
            }
        }