public DiscQueryEngine(
     IImageFileFactory imageFileFactory,
     IImageResizer imageResizer,
     IFileSystemEntryComparer fileSystemEntryComparer)
 {
     _imageFileFactory        = imageFileFactory ?? throw new ArgumentNullException(nameof(imageFileFactory));
     _imageResizer            = imageResizer ?? throw new ArgumentNullException(nameof(imageResizer));
     _fileSystemEntryComparer = fileSystemEntryComparer ?? throw new ArgumentNullException(nameof(fileSystemEntryComparer));
 }
Пример #2
0
        public Photo(IImageFileFactory imageFactory, IThumbnailService thumbnailService, uint id, long unixTime) : base(id)
        {
            imageFileFactory      = imageFactory;
            this.thumbnailService = thumbnailService;

            time = DateTimeUtil.ToDateTime(unixTime);
            tags = new List <Tag>();

            description = string.Empty;
            rating      = 0;
        }
Пример #3
0
        public ImageLoaderThread(IImageFileFactory imageFileFactory)
        {
            this.imageFileFactory = imageFileFactory;

            queue           = new List <RequestItem> ();
            requests_by_uri = new Dictionary <SafeUri, RequestItem> ();
            // requests_by_path = Hashtable.Synchronized (new Hashtable ());
            processed_requests = new Queue();

            pending_notify = new ThreadNotify(new Gtk.ReadyEvent(HandleProcessedRequests));

            instances.Add(this);
        }
Пример #4
0
        // Constructor
        public PhotoStore(IImageFileFactory imageFileFactory, IThumbnailService thumbnailService, IDb db, bool isNew)
            : base(db, false)
        {
            this.imageFileFactory = imageFileFactory;
            this.thumbnailService = thumbnailService;

            if (!isNew)
            {
                return;
            }

            Database.Execute(
                "CREATE TABLE photos (\n" +
                "       id                      INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, \n" +
                "       time                    INTEGER NOT NULL, \n" +
                "       base_uri                STRING NOT NULL, \n" +
                "       filename                STRING NOT NULL, \n" +
                "       description             TEXT NOT NULL, \n" +
                "       roll_id                 INTEGER NOT NULL, \n" +
                "       default_version_id      INTEGER NOT NULL, \n" +
                "       rating                  INTEGER NULL \n" +
                ")");

            Database.Execute(
                "CREATE TABLE photo_tags (\n" +
                "       photo_id        INTEGER, \n" +
                "       tag_id          INTEGER, \n" +
                "       UNIQUE (photo_id, tag_id)\n" +
                ")");

            Database.Execute(
                "CREATE TABLE photo_versions (\n" +
                "       photo_id        INTEGER, \n" +
                "       version_id      INTEGER, \n" +
                "       name            STRING, \n" +
                "       base_uri        STRING NOT NULL, \n" +
                "       filename        STRING NOT NULL, \n" +
                "       import_md5      TEXT NULL, \n" +
                "       protected       BOOLEAN, \n" +
                "       UNIQUE (photo_id, version_id)\n" +
                ")");

            Database.Execute("CREATE INDEX idx_photo_versions_id ON photo_versions(photo_id)");
            Database.Execute("CREATE INDEX idx_photo_versions_import_md5 ON photo_versions(import_md5)");
            Database.Execute("CREATE INDEX idx_photos_roll_id ON photos(roll_id)");
        }
Пример #5
0
 public ThumbnailLoader(IImageFileFactory imageFileFactory, IThumbnailService thumbnailService) : base(imageFileFactory)
 {
     this.thumbnailService = thumbnailService;
 }
Пример #6
0
 public FileImportSource(Uri root, IImageFileFactory factory, IFileSystem fileSystem)
 {
     this.root       = root;
     this.fileSystem = fileSystem;
     this.factory    = factory;
 }
Пример #7
0
 public ImageThumbnailer(SafeUri fileUri, IImageFileFactory factory, IFileSystem fileSystem)
 {
     this.fileUri    = fileUri;
     this.factory    = factory;
     this.fileSystem = fileSystem;
 }
Пример #8
0
 public MultiFileImportSource(IEnumerable <SafeUri> uris, IImageFileFactory factory, IFileSystem fileSystem)
     : base(null, factory, fileSystem)
 {
     this.uris = uris;
 }
Пример #9
0
 public virtual IImportSource GetFileImportSource(IImageFileFactory factory, IFileSystem fileSystem)
 {
     return(new FileImportSource(Root, factory, fileSystem));
 }
Пример #10
0
 public ThumbnailerFactory(IImageFileFactory factory, IFileSystem fileSystem)
 {
     this.factory    = factory;
     this.fileSystem = fileSystem;
 }
Пример #11
0
 public Db(IImageFileFactory imageFileFactory, IThumbnailService thumbnailService, IUpdaterUI updaterDialog)
 {
     this.imageFileFactory = imageFileFactory;
     this.thumbnailService = thumbnailService;
     this.updaterDialog    = updaterDialog;
 }
Пример #12
0
 public override IImportSource GetFileImportSource(IImageFileFactory factory, IFileSystem fileSystem)
 {
     return(new MultiFileImportSource(uris, factory, fileSystem));
 }