Ejemplo n.º 1
0
        public MainPresenter(IApplicationController controller, IMainView view, IThumbnailConfig configuration, IConfigurationStorage configurationStorage,
                             IThumbnailManager thumbnailManager, IThumbnailDescriptionViewFactory thumbnailDescriptionViewFactory)
            : base(controller, view)
        {
            this._configuration        = configuration;
            this._configurationStorage = configurationStorage;

            this._thumbnailDescriptionViewFactory = thumbnailDescriptionViewFactory;
            this._thumbnailManager = thumbnailManager;

            this._thumbnailDescriptionViews = new Dictionary <IntPtr, IThumbnailDescriptionView>();
            this._exitApplication           = false;

            this.View.FormActivated              = this.Activate;
            this.View.FormMinimized              = this.Minimize;
            this.View.FormCloseRequested         = this.Close;
            this.View.ApplicationSettingsChanged = this.SaveApplicationSettings;
            this.View.ThumbnailsSizeChanged      = this.UpdateThumbnailsSize;
            this.View.ThumbnailStateChanged      = this.UpdateThumbnailState;
            this.View.ForumUrlLinkActivated      = this.OpenForumUrlLink;
            this.View.ApplicationExitRequested   = this.ExitApplication;

            this._thumbnailManager.ThumbnailsAdded      = this.ThumbnailsAdded;
            this._thumbnailManager.ThumbnailsUpdated    = this.ThumbnailsUpdated;
            this._thumbnailManager.ThumbnailsRemoved    = this.ThumbnailsRemoved;
            this._thumbnailManager.ThumbnailSizeChanged = this.ThumbnailSizeChanged;
        }
Ejemplo n.º 2
0
        public ThumbnailManager(IThumbnailConfig configuration, IThumbnailViewFactory factory)
        {
            this._configuration        = configuration;
            this._thumbnailViewFactory = factory;

            this._activeClientHandle = (IntPtr)0;
            this._activeClientTitle  = ThumbnailManager.DefaultClientTitle;

            this.EnableViewEvents();
            this._isHoverEffectActive = false;

            this._thumbnailViews = new Dictionary <IntPtr, IThumbnailView>();

            //  DispatcherTimer setup
            this._thumbnailUpdateTimer          = new DispatcherTimer();
            this._thumbnailUpdateTimer.Tick    += ThumbnailUpdateTimerTick;
            this._thumbnailUpdateTimer.Interval = new TimeSpan(0, 0, 0, 0, configuration.ThumbnailRefreshPeriod);
        }
 public ConfigurationStorage(IAppConfig appConfig, IThumbnailConfig thumbnailConfig)
 {
     this._appConfig       = appConfig;
     this._thumbnailConfig = thumbnailConfig;
 }