public Photo CreatePhoto() { ImageListRecord imageList = dfr[PhotoDataSetIndex.ImageList].Data as ImageListRecord; ImageItemRecord item = new ImageItemRecord(device.IsBE); item.Id = dfr.NextId++; imageList.AddItem(item); Photo photo = new Photo(item, this); photos[photo.Id] = photo; if (masterAlbum != null) { masterAlbum.Add(photo); } addedPhotos.Add(photo); return(photo); }
private static void AddDirectory(Device device, Album album, string dir) { foreach (string file in Directory.GetFiles (dir)) { try { Gdk.Pixbuf pixbuf = new Gdk.Pixbuf (file); Photo photo = device.PhotoDatabase.CreatePhoto (); AddThumbnails (device, photo, pixbuf); pixbuf.Dispose (); photo.FullSizeFileName = file; album.Add (photo); } catch (GLib.GException e) { } catch (Exception e) { Console.WriteLine (e); } } foreach (string child in Directory.GetDirectories (dir)) { AddDirectory (device, album, child); } }