public PresenterUserSettingsRightAutoShownTabs ( IViewUserSettingsRightAutoShownTabs viewRules, IViewDialog dialog, IViewUserSettings viewUserSettings, IViewUserSettingsButtonsDown viewUserSettingsButtonsDown, ISettingsServiceXmlSerialization settingsServiceXmlSerialization, IViewMainSplContPanelUpTabs viewMainSplContPanelUpTabs ) { _view = viewRules; _dialog = dialog; _viewUserSettings = viewUserSettings; _viewUserSettingsButtonsDown = viewUserSettingsButtonsDown; _settingsServiceXmlSerialization = settingsServiceXmlSerialization; _viewMainSplContPanelUpTabs = viewMainSplContPanelUpTabs; //subscribe to events if (_view == null) { return; } _view.Load += ViewRules_Load; _view.ListLeftSimulatedTextChanged += ViewRules_ListLeftSimulatedTextChanged; _view.ItemsListTextChanged += ViewRules_ItemsListTextChanged; _view.RegExStringTextChanged += ViewRules_RegExStringTextChanged; _view.RuleNamesSelectionChanged += ViewRules_RuleNamesSelectionChanged; _view.ClickNewButton += ViewRules_ClickNewButton; _view.ClickDeleteButton += ViewRules_ClickDeleteButton; _view.ClickRenameButton += ViewRules_ClickRenameButton; if (_dialog != null) { _dialog.ClickCancelMouseButton += Dialog_ClickCancelMouseButton; _dialog.ClickOkMouseButton += Dialog_ClickOkMouseButton; } _view.EnabledChangedView += View_EnabledChanged; }
public PresenterMain( IViewMain viewMain, IViewMin viewMin, IViewUserSettings viewUserSettings, IViewAbout viewAbout, ISettingsService settings, IResourcesService resources, IViewMainSplContPanelUpTabs viewMainSplContPanelUp, IViewUserSettingsButtonsDown viewUserSettingsButtonsDown, Pasting pasting ) { _view = viewMain; _viewMin = viewMin; _viewAbout = viewAbout; _settings = settings; _resources = resources; _viewUserSettings = viewUserSettings; _viewMainSplContPanelUp = viewMainSplContPanelUp; _viewUserSettingsButtonsDown = viewUserSettingsButtonsDown; _pasting = pasting; //set initial form settings if (_settings != null) { if (_view != null) { _view.Size = _settings.SizeMain; _view.StartPosition = FormStartPosition.Manual; _view.Location = _settings.Location; } } if (settings != null && settings.Activated) { if (_resources != null) { _view?.SetNotifyIconImage(IsWindowsLightThemeActive() ? _resources.ActivatedForLightTheme : _resources.ActivatedForDarkTheme); } } else { if (_resources != null) { _view?.SetNotifyIconImage(IsWindowsLightThemeActive() ? _resources.DeactivatedForLightTheme : _resources.DeactivatedForDarkTheme); } } if (_view == null) { return; } _view.SetNotifyIconVisible(true); if (_resources != null) { _view.SetImageFormIcon1(settings != null && settings.Locked ? _resources.Locked : _resources.Unlocked); _view.SetImageFormIcon2(_resources.MinimizeUnselected); _view.SetImageFormIcon3(_resources.Closed); } //subscribe to events _view.Load += OnLoadView; }