public PresenterUserSettingsRightAppearance
        (
            IViewUserSettingsRightAppearance view,
            ISettingsService settings,
            IViewUserSettingsButtonsDown viewUserSettingsButtonsDown,
            IViewMain viewMain,
            Validate validate,
            IViewDialog dialog
        )
        {
            _view     = view;
            _settings = settings;
            _viewUserSettingsButtonsDown = viewUserSettingsButtonsDown;
            _viewMain = viewMain;
            _validate = validate;
            _dialog   = dialog;

            //subscribe to events
            if (view != null)
            {
                view.Load += View_Load;
            }

            _cred = new NetworkCredential();
        }
Пример #2
0
        public PresenterUserSettingsDownButtons
        (
            IViewUserSettingsButtonsDown viewUserSettingsButtonsDown,
            IViewUserSettings viewUserSettings,
            ISettingsService settings
        )
        {
            _view             = viewUserSettingsButtonsDown;
            _viewUserSettings = viewUserSettings;
            _settings         = settings;

            //subscribe to events
            if (_view != null)
            {
                _view.Load += OnLoadedViewUserSettings;
            }
        }
        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 PresenterUserSettingsRightManuallyShownTabs
        (
            IViewUserSettingsRightManuallyShownTabs manuallyShownTabs,
            IViewDialog dialog,
            IViewUserSettings viewUserSettings,
            IViewUserSettingsButtonsDown viewUserSettingsButtonsDown,
            ISettingsServiceXmlSerialization settingsServiceXmlSerialization
        )
        {
            _view                            = manuallyShownTabs;
            _dialog                          = dialog;
            _viewUserSettings                = viewUserSettings;
            _viewUserSettingsButtonsDown     = viewUserSettingsButtonsDown;
            _settingsServiceXmlSerialization = settingsServiceXmlSerialization;

            //subscribe to events
            if (_view != null)
            {
                _view.Load              += OnLoadedManuallyShownTabs;
                _view.DragDropListBox   += ManuallyShownTabs_DragDropListBox;
                _view.DragOverListBox   += ManuallyShownTabs_DragOverListBox;
                _view.MouseDownListBox  += ManuallyShownTabs_MouseDownListBox;
                _view.MouseUpListbox    += ManuallyShownTabs_MouseUpListbox;
                _view.AddClickMenu      += ManuallyShownTabs_AddClickMenu;
                _view.DeleteClickMenu   += ManuallyShownTabs_DeleteClickMenu;
                _view.EditNameClickMenu += ManuallyShownTabs_EditNameClickMenu;
                _view.TxtChanged        += ViewManuallyShownTabs_TxtChanged;
            }

            if (_dialog == null)
            {
                return;
            }
            _dialog.ClickCancelMouseButton += Dialog_ClickCancelMouseButton;
            _dialog.ClickOkMouseButton     += Dialog_ClickOkMouseButton;
        }
Пример #5
0
        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;
        }