Ejemplo n.º 1
0
        private void MainForm_Shown(object sender, EventArgs e)
        {
            IIconExtractor extractor = IconExtractor.Default;

            ImageUploadWatcher watcher =
                new ImageUploadWatcher()
            {
                PathToWatch = Properties.Settings.Default.ImageUploadPool,
            };

            Presenter p = new Presenter(this, watcher, extractor);

            p.Start();
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Initializes a new instance of the Presenter class.
        /// </summary>
        /// <param name="screen"></param>
        /// <param name="uploadWatcher"></param>
        public Presenter(IImageScreen screen,
                         ImageUploadWatcher uploadWatcher,
                         IIconExtractor extractor)
        {
            this.screen        = screen;
            this.uploadWatcher = uploadWatcher;
            this.extractor     = extractor;

            this.screen.Observer         = this;
            this.worker                  = new System.ComponentModel.BackgroundWorker();
            worker.WorkerReportsProgress = true;
            worker.RunWorkerCompleted   += worker_RunWorkerCompleted;
            worker.ProgressChanged      += new System.ComponentModel.ProgressChangedEventHandler(worker_ProgressChanged);
            worker.DoWork               += worker_DoWork;

            imgsQueue = new Queue <ImageDetail[]>();

            this.uploadWatcher.ImagesUploaded += uploadWatcher_ImagesUploaded;
        }
Ejemplo n.º 3
0
        /// <summary>
        /// Initializes a new instance of the Presenter class.
        /// </summary>
        /// <param name="screen"></param>
        /// <param name="uploadWatcher"></param>
        public Presenter(IImageScreen screen,
            ImageUploadWatcher uploadWatcher,
            IIconExtractor extractor)
        {
            this.screen = screen;
            this.uploadWatcher = uploadWatcher;
            this.extractor = extractor;

            this.screen.Observer = this;
            this.worker = new System.ComponentModel.BackgroundWorker();
            worker.WorkerReportsProgress = true;
            worker.RunWorkerCompleted += worker_RunWorkerCompleted;
            worker.ProgressChanged += new System.ComponentModel.ProgressChangedEventHandler(worker_ProgressChanged);
            worker.DoWork += worker_DoWork;

            imgsQueue = new Queue<ImageDetail[]>();

            this.uploadWatcher.ImagesUploaded += uploadWatcher_ImagesUploaded;
        }
Ejemplo n.º 4
0
        private void MainForm_Shown(object sender, EventArgs e)
        {
            IIconExtractor extractor = IconExtractor.Default;

            ImageUploadWatcher watcher =
                new ImageUploadWatcher() { PathToWatch = Properties.Settings.Default.ImageUploadPool, };

            Presenter p = new Presenter(this, watcher, extractor);
            p.Start();
        }