Beispiel #1
0
        public ImageViewerPresenter(IAppController appController, IImageEditor view, ILogService logService,
                                    IMessageService messageService, IRepository <IImageList> repository, ISlideshowService slideshowService)
            : base(appController, view, logService, messageService)
        {
            Repository       = repository;
            SlideshowService = slideshowService;

            SlideshowService.Repository = Repository;

            AppController.EventController
            .Subscribe(View.MenuPanel, nameof(View.MenuPanel.OpenFile), MenuPanel_OpenFile)
            .Subscribe(View.MenuPanel, nameof(View.MenuPanel.SaveFile), MenuPanel_SaveFile)
            .Subscribe(View.MenuPanel, nameof(View.MenuPanel.CloseFile), MenuPanel_CloseFile)

            .Subscribe(View.MenuPanel, nameof(View.MenuPanel.PlayAnimation), MenuPanel_PlayAnimation)
            .Subscribe(View.MenuPanel, nameof(View.MenuPanel.StopAnimation), MenuPanel_StopAnimation)

            .Subscribe <string>(Repository, nameof(Repository.ItemAdded), Repository_ItemAdded)
            .Subscribe <string>(Repository, nameof(Repository.ItemChanged), Repository_ItemChanged)
            .Subscribe <string>(Repository, nameof(Repository.ItemRemoved), Repository_ItemRemoved)

            .AddCondition(View.MenuPanel, nameof(View.MenuPanel.SaveFile), SaveFileCondition)
            .AddCondition(View.MenuPanel, nameof(View.MenuPanel.CloseFile), CloseFileCondition)
            .AddCondition(View.MenuPanel, nameof(View.MenuPanel.PlayAnimation), PlayAnimationCondition)
            .AddCondition(View.MenuPanel, nameof(View.MenuPanel.StopAnimation), StopAnimationCondition);
        }
Beispiel #2
0
        public ImageEditorPresenter(IAppController appController, IImageEditor view, ILogService logService,
                                    IMessageService messageService, IRepository <IImageList> repository, ISlideshowService slideshowService,
                                    IImageListSupport[] imageListTools, IImageSupport[] imageTools)
            : base(appController, view, logService, messageService, repository, slideshowService)
        {
            ImageListTools = imageListTools;
            ImageTools     = imageTools;

            if (imageListTools.Length > 0)
            {
                View.ToolPanels.AddPanel(nameof(IImageListSupport), Resources.AnimatedTools).SetTools(ImageListTools);
            }

            if (imageTools.Length > 0)
            {
                View.ToolPanels.AddPanel(nameof(IImageSupport), Resources.StaticTools).SetTools(ImageTools);
            }

            AppController.EventController
            .Subscribe(View.MenuPanel, nameof(View.MenuPanel.ApplyTool), MenuPanel_ApplyTool)
            .Subscribe(View.ImagePanels, nameof(View.ImagePanels.SelectedPanelChanged), OnLoadDefaultSettings)
            .Subscribe(View.ToolPanels, nameof(View.ToolPanels.SelectedPanelChanged))
            .Subscribe <string>(Repository, nameof(Repository.ItemAdded), Repository_ItemAdded)
            .Subscribe <string>(Repository, nameof(Repository.ItemRemoved), Repository_ItemRemoved);

            foreach (IToolPanel toolPanel in View.ToolPanels)
            {
                AppController.EventController
                .Subscribe(toolPanel, nameof(toolPanel.Tuning), ToolPanel_Tuning)
                .AddCondition(toolPanel, nameof(toolPanel.Tuning), TuningCondition)

                .Subscribe(toolPanel, nameof(toolPanel.SelectedToolChanged), ToolPanel_SelectedToolChanged,
                           OnLoadDefaultSettings);
            }

            AppController.EventController
            .AddCondition(View.MenuPanel, nameof(View.MenuPanel.ApplyTool), ApplyToolCondition);
        }
 public SlideshowController(ISlideshowService slideshowService)
 {
     _slideshowService = slideshowService;
 }
Beispiel #4
0
 public HomeController(ISlideshowService slideshowService, IProductService productService, ICategoryService categoryService)
 {
     _slideshowService = slideshowService;
     _productService   = productService;
     _categoryService  = categoryService;
 }