Esempio n. 1
0
 private void MakeCollections(TreeNode treeNode, MongoDB.Driver.MongoDatabase mongoDatabase,bool bRefresh)
 {
     //throw new NotImplementedException();
     if (bRefresh) treeNode.Nodes.Clear();
     if (treeNode.Nodes.Count <= 0)
     {
         foreach (string s in mongoDatabase.GetCollectionNames())
         {
             if (s.IndexOf("system") == 0) // system belong to Db,not Collections!
                 continue;
             TreeNode tn = new TreeNode(s);
             tn.ImageIndex = (int)Data.Data.DbCludes.table;
             tn.SelectedImageIndex = (int)Data.Data.DbCludes.table;
             Data.MTag mt = new Data.MTag(Data.Data.DbCludes.table);
             mt.tag = mongoDatabase.GetCollection(s);
             tn.Tag = mt;
             AddIndexes(tn);
             treeNode.Nodes.Add(tn);
         }
         treeNode.ExpandAll();
     }
 }