示例#1
0
 /// <summary>
 /// Close the FileSet
 /// </summary>
 public void Close()
 {
     Locker.Invoke(() =>
     {
         if (Btree.IsOpen && Btree.RootNode != null)
         {
             foreach (MruItem o in Btree.MruManager.Values)
             {
                 for (int i = 0; i < ((BTreeNodeOnDisk)o.Value).Count; i++)
                 {
                     object f = ((BTreeNodeOnDisk)o.Value).Slots[i].Value.Data;
                     if (f is File)
                     {
                         ((File)f).Close();
                     }
                 }
             }
             for (int i = 0; i < Btree.RootNode.Count; i++)
             {
                 if (Btree.RootNode.Slots[i].Value.Data is File)
                 {
                     ((File)Btree.RootNode.Slots[i].Value.Data).Close();
                 }
             }
             Btree.Close();
         }
         //DiskBuffer.ClearData();
     });
 }