protected override void Reload ()
{
System.Collections.Hashtable ht = new System.Collections.Hashtable ();
Photo [] photos = query.Store.Query ((Tag [])null, null, null, null);
foreach (Photo p in photos) {
if (ht.Contains (p.DirectoryPath)) {
DirectoryAdaptor.Group group = (DirectoryAdaptor.Group) ht [p.DirectoryPath];
group.Count += 1;
} else
ht [p.DirectoryPath] = new DirectoryAdaptor.Group ();
}
Console.WriteLine ("Count = {0}", ht.Count);
dirs = new System.Collections.DictionaryEntry [ht.Count];
ht.CopyTo (dirs, 0);
Array.Sort (dirs, new DirectoryAdaptor.Group ());
Array.Sort (query.Photos, new Photo.CompareDirectory ());
if (!order_ascending) {
Array.Reverse (dirs);
Array.Reverse (query.Photos);
}
if (Changed != null)
Changed (this);
}