//NOTE: Don't use IoC to avoid additional dependencies. private void InitializePresenters(bool isRunOnStartup) { NavigationWindow navigationWindow = new NavigationWindow(new PresentationService()); MainWindow = navigationWindow; IRegistryService registryService = new RegistryService(); ISettingsSerializer settingsSerializer = new SettingsSerializer(registryService); IPresenter navigationPresenter = new NavigationPresenter(navigationWindow, settingsSerializer, new KeyboardListener(), new MatchModelMapper(), new PresentationService(), new NavigationServiceBuilder(isRunOnStartup)); TrayView trayView = new TrayView(); IPresenter trayPresenter = new TrayIconPresenter(trayView, settingsSerializer); SettingsWindow settingsWindow = new SettingsWindow(); IPresenter settingsPresenter = new SettingsPresenter(settingsWindow, settingsSerializer); List <IPresenter> presenters = new List <IPresenter> { navigationPresenter, trayPresenter, settingsPresenter }; _presenterManager = new PresenterManager(presenters); _presenterManager.Exited += HandleExited; }
public void Init() { _fakeView = Substitute.For <ISettingsView>(); _fakeModel = Substitute.For <ISettingsModel>(); _fakeUserPreference = Substitute.For <IUserPreference>(); _uut = new SettingsPresenter(_fakeView, _fakeModel, _fakeUserPreference); }
public MainViewTests() { ErrorMessageView errorMessageView = new ErrorMessageView(); DeleteConfirmView deleteConfirmView = new DeleteConfirmView(); mainView = new MainView(errorMessageView); SettingsPresenter settingsPresenter = new SettingsPresenter(new SettingsUC(errorMessageView), errorMessageView); StoreFacade facade = ServicesInitialiser.facade; UnitsService unitsService = ServicesInitialiser.unitsService; UnitsDetailUC unitsDetailUC = new UnitsDetailUC(errorMessageView); UnitsDetailPresenter unitsDetailPresenter = new UnitsDetailPresenter(unitsDetailUC, facade); UnitsPresenter unitsPresenter = new UnitsPresenter(new UnitsUC(errorMessageView), facade, unitsDetailPresenter, deleteConfirmView, errorMessageView); SuppliersService supplierService = ServicesInitialiser.suppliersService; SuppliersDetailUC suppliersDetailUC = new SuppliersDetailUC(errorMessageView); SuppliersDetailPresenter suppliersDetailPresenter = new SuppliersDetailPresenter(suppliersDetailUC, facade); SuppliersPresenter suppliersPresenter = new SuppliersPresenter(new SuppliersUC(errorMessageView), suppliersDetailPresenter, facade, deleteConfirmView, errorMessageView); ProductsService productsService = ServicesInitialiser.productsService; ProductsDetailUC productsDetailUC = new ProductsDetailUC(errorMessageView); ProductsDetailPresenter productsDetailPresenter = new ProductsDetailPresenter(productsDetailUC, facade); ProductsPresenter productsPresenter = new ProductsPresenter(new ProductsUC(errorMessageView), productsDetailPresenter, facade, deleteConfirmView, errorMessageView); ParametersService parametersService = ServicesInitialiser.parametersService; ParametersDetailUC parametersDetailUC = new ParametersDetailUC(errorMessageView); ParametersDetailPresenter parametersDetailPresenter = new ParametersDetailPresenter(parametersDetailUC, facade); ParametersPresenter parametersPresenter = new ParametersPresenter(new ParametersUC(errorMessageView), parametersDetailPresenter, facade, deleteConfirmView, errorMessageView); ImagesService imagesService = ServicesInitialiser.imagesService; ImagesDetailUC imagesDetailUC = new ImagesDetailUC(errorMessageView); ImagesDetailPresenter imagesDetailPresenter = new ImagesDetailPresenter(imagesDetailUC, facade); ImagesPresenter imagesPresenter = new ImagesPresenter(new ImagesUC(errorMessageView), imagesDetailPresenter, ServicesInitialiser.facade, deleteConfirmView, errorMessageView); GroupsService groupsService = ServicesInitialiser.groupsService; GroupsDetailUC groupsDetailUC = new GroupsDetailUC(errorMessageView); GroupsDetailPresenter groupsDetailPresenter = new GroupsDetailPresenter(groupsDetailUC, ServicesInitialiser.facade); GroupsPresenter groupsPresenter = new GroupsPresenter(new GroupsUC(errorMessageView), groupsDetailPresenter, ServicesInitialiser.facade, deleteConfirmView, errorMessageView); CategoriesService categoriesService = ServicesInitialiser.categoriesService; CategoriesDetailUC categoriesDetailUC = new CategoriesDetailUC(errorMessageView); CategoriesDetailPresenter categoriesDetailPresenter = new CategoriesDetailPresenter(categoriesDetailUC, facade); CategoriesPresenter categoriesPresenter = new CategoriesPresenter(new CategoriesUC(errorMessageView), categoriesDetailPresenter, facade, deleteConfirmView, errorMessageView); mainPresenter = new MainPresenter(mainView, settingsPresenter, unitsPresenter, unitsDetailPresenter, suppliersPresenter, suppliersDetailPresenter, productsPresenter, productsDetailPresenter, parametersPresenter, parametersDetailPresenter, imagesPresenter, imagesDetailPresenter, groupsPresenter, groupsDetailPresenter, categoriesPresenter, categoriesDetailPresenter, facade, deleteConfirmView); }
public SettingsDialog(SettingsPresenter presenter, ISettingsRepository model) { InitializeComponent(); DataContext = this; this.presenter = presenter; this.model = model; }
public void ShowSettings() { var view = new Settings(this); var model = new SettingsModel(session); var presenter = new SettingsPresenter(model, view); ShowControl(view); }
public SettingsForm() { InitializeComponent(); IApplicationSettings settings = new ApplicationSettings(); _presenter = new SettingsPresenter(this, settings); _presenter.Initialize(); }
public void ChangePasswordCatchesException() { MockedDummyProfileScreenSettingsService _mockedDummy = new MockedDummyProfileScreenSettingsService(); IProfileScreen _profileScreen = new MockedDummyProfileScreenView(); ISettingsPresenter _profileScreenPresenter = new SettingsPresenter(_profileScreen, _mockedDummy._profileScreenSettingsService); _mockedDummy.error = true; Assert.Throws <Exception>(() => _profileScreenPresenter.ChangePassword("1234", "122343", "1234")); }
public FrmTheme() { InitializeComponent(); setFormTheme(); settingsPresenter = new SettingsPresenter(); checkDarkMode.Checked = settingsPresenter.getCurrentMode(); cmbTheme.SelectedIndex = cmbTheme.FindStringExact(settingsPresenter.getCurrentTheme()); }
public void ChangeLastNameChanges() { MockedDummyProfileScreenSettingsService _mockedDummy = new MockedDummyProfileScreenSettingsService(); IProfileScreen _profileScreen = new MockedDummyProfileScreenView(); ISettingsPresenter _profileScreenPresenter = new SettingsPresenter(_profileScreen, _mockedDummy._profileScreenSettingsService); _profileScreenPresenter.ChangeLastName("MasterGigo"); Assert.AreEqual("MasterGigo", _profileScreen.LastName); }
public void ChangeGenderCatchesException() { MockedDummyProfileScreenSettingsService _mockedDummy = new MockedDummyProfileScreenSettingsService(); IProfileScreen _profileScreen = new MockedDummyProfileScreenView(); ISettingsPresenter _profileScreenPresenter = new SettingsPresenter(_profileScreen, _mockedDummy._profileScreenSettingsService); _mockedDummy.error = true; _profileScreenPresenter.ChangeGender("F"); Assert.AreNotEqual("F", _profileScreen.Gender); }
public void ChangeAgeChanges() { MockedDummyProfileScreenSettingsService _mockedDummy = new MockedDummyProfileScreenSettingsService(); IProfileScreen _profileScreen = new MockedDummyProfileScreenView(); ISettingsPresenter _profileScreenPresenter = new SettingsPresenter(_profileScreen, _mockedDummy._profileScreenSettingsService); _profileScreenPresenter.ChangeAge(2); Assert.AreEqual(2, _profileScreen.Age); }
public void ChangeGenderChanges() { MockedDummyProfileScreenSettingsService _mockedDummy = new MockedDummyProfileScreenSettingsService(); IProfileScreen _profileScreen = new MockedDummyProfileScreenView(); ISettingsPresenter _profileScreenPresenter = new SettingsPresenter(_profileScreen, _mockedDummy._profileScreenSettingsService); _profileScreenPresenter.ChangeGender("F"); Assert.AreEqual("F", _profileScreen.Gender); }
public void ChangeEmailCatchesException() { MockedDummyProfileScreenSettingsService _mockedDummy = new MockedDummyProfileScreenSettingsService(); IProfileScreen _profileScreen = new MockedDummyProfileScreenView(); ISettingsPresenter _profileScreenPresenter = new SettingsPresenter(_profileScreen, _mockedDummy._profileScreenSettingsService); _mockedDummy.error = true; _profileScreenPresenter.ChangeEmail("*****@*****.**"); Assert.AreNotEqual("*****@*****.**", _profileScreen.Email); }
public void ChangePasswordChanges() { MockedDummyProfileScreenSettingsService _mockedDummy = new MockedDummyProfileScreenSettingsService(); IProfileScreen _profileScreen = new MockedDummyProfileScreenView(); ISettingsPresenter _profileScreenPresenter = new SettingsPresenter(_profileScreen, _mockedDummy._profileScreenSettingsService); _profileScreenPresenter.ChangePassword("1234", "12234", "1234"); Assert.AreEqual("12234", _mockedDummy._user.password); }
public void ChangeLastNameCatchesException() { MockedDummyProfileScreenSettingsService _mockedDummy = new MockedDummyProfileScreenSettingsService(); IProfileScreen _profileScreen = new MockedDummyProfileScreenView(); ISettingsPresenter _profileScreenPresenter = new SettingsPresenter(_profileScreen, _mockedDummy._profileScreenSettingsService); _mockedDummy.error = true; _profileScreenPresenter.ChangeLastName("MasterGigo"); Assert.AreNotEqual("MasterGigo", _profileScreen.LastName); }
public void ChangeEmailChanges() { MockedDummyProfileScreenSettingsService _mockedDummy = new MockedDummyProfileScreenSettingsService(); IProfileScreen _profileScreen = new MockedDummyProfileScreenView(); ISettingsPresenter _profileScreenPresenter = new SettingsPresenter(_profileScreen, _mockedDummy._profileScreenSettingsService); _profileScreenPresenter.ChangeEmail("*****@*****.**"); Assert.AreEqual("*****@*****.**", _profileScreen.Email); }
private void setFormTheme() { th = new ThemeHelper(); settingsPresenter = new SettingsPresenter(); th.setFormColor(this); th.setPanelColor(panelTop); th.setGroupBoxColor(groupSecurity); th.setGroupBoxColor(groupTheme); th.setButtonColor(btnSecurityApply); th.setButtonColor(btnThemeApply); }
internal void DataBind(SettingsPresenter presenter) { if (presenter != null) { settingsName.DataSource = presenter.SettingsNames; settingsName.DataBindings.Add("SelectedItem", presenter, "SettingsNameSelected", true, DataSourceUpdateMode.OnValidation); settingsName.SelectedIndexChanged += (s, args) => settingsName.DataBindings["SelectedItem"].WriteValue(); settingsValue.DataBindings.Add("Text", presenter, "SettingsValue", true, DataSourceUpdateMode.OnPropertyChanged); } }
public void ConfigIsSavedOnSave() { //arrange var presenter = new SettingsPresenter(_view.Object, _configService.Object, _folderBrowserFactory.Object); //act //simulate Update button click _view.Raise(v => v.Save += null, EventArgs.Empty); //assert _configService.Verify(s => s.SaveConfiguration(_config)); }
protected override void Context() { _subPresenterManager = SubPresenterHelper.Create <ISettingsItemPresenter>(); _userSettings = _subPresenterManager.CreateFake(SettingsItems.UserGeneralSettings); _appSettings = _subPresenterManager.CreateFake(SettingsItems.ApplicationSettings); _userDisplayUnitSettings = _subPresenterManager.CreateFake(SettingsItems.UserDisplayUnitsSettings); _dialogCreator = A.Fake <IDialogCreator>(); _workspace = A.Fake <ICoreWorkspace>(); _view = A.Fake <ISettingsView>(); sut = new SettingsPresenter(_view, _subPresenterManager, _dialogCreator, _workspace); }
public void ViewIsPopulatedOnRefresh() { //arrange var presenter = new SettingsPresenter(_view.Object, _configService.Object, _folderBrowserFactory.Object); //act presenter.RefreshView(); //assert Assert.AreEqual(Name, _view.Object.UserName, "Name"); Assert.AreEqual(Email, _view.Object.EmailAddress, "Email"); Assert.AreEqual(RepoLocation, _view.Object.DefaultRepositoryLocation, "Default Repo Location"); }
public Setting(UserInfObject _userInfObject, MainPage _mainPage) { InitializeComponent(); name_txt.Text = _userInfObject.getName(); this._userInfObject = _userInfObject; userName_txt.Text = _userInfObject.getUsername(); Id_txt.Text = _userInfObject.getId().ToString(); passwordHide(); this._mainPage = _mainPage; presenter = new SettingsPresenter(this); }
public TestSuiteView() { State = new TestSuiteState(); TestCasesPresenter = new TestCasesPresenter(new RenameVariableWindow(), new FilterWindow(), new ConnectionStringWindow(), new TestCaseCollectionManager(), State.TestCases, State.Variables, State.ConnectionStringNames); TemplatePresenter = new TemplatePresenter(new TemplateManager(), State.Template); SettingsPresenter = new SettingsPresenter(new SettingsManager(), State.Settings); TestListPresenter = new TestListPresenter(new TestListManager(), State.Tests, State.TestCases, State.Variables, State.Template, State.GlobalVariables); TestSuitePresenter = new TestSuitePresenter(new TestSuiteManager(), State.Tests, State.Settings); MacroPresenter = new MacroPresenter(); InitializeComponent(); DeclareBindings(); BindPresenter(); }
public void OnBrowserDefaultRepoLocation_WhenUserCancels_ViewRemainsUnchanged() { //arrange _view.Object.DefaultRepositoryLocation = RepoLocation; _folderBrowser.Object.SelectedPath = OtherRepoLocation; _folderBrowser.Setup(f => f.ShowDialog()).Returns(DialogResult.Cancel); var presenter = new SettingsPresenter(_view.Object, _configService.Object, _folderBrowserFactory.Object); //act _view.Raise(v => v.BrowseDefaultRepositoryLocation += null, EventArgs.Empty); //assert Assert.AreEqual(RepoLocation, _view.Object.DefaultRepositoryLocation); }
protected void DeclareBindings() { testCasesControl.DataBind(TestCasesPresenter); settingsControl.DataBind(SettingsPresenter); templateControl.DataBind(TemplatePresenter); testListControl.DataBind(TestListPresenter); TemplatePresenter.PropertyChanged += (sender, e) => TestListPresenter.Template = TemplatePresenter.Template; TestListPresenter.PropertyChanged += (sender, e) => TestSuitePresenter.RefreshCommands(); TestSuitePresenter.TestSuiteLoaded += (sender, e) => { SettingsPresenter.Refresh(); TestListPresenter.Refresh(); }; }
public void ConfigIsPopulatedFromViewOnSave() { //arrange var presenter = new SettingsPresenter(_view.Object, _configService.Object, _folderBrowserFactory.Object); //simulate user input _view.Object.UserName = OtherName; _view.Object.EmailAddress = OtherEmail; _view.Object.DefaultRepositoryLocation = OtherRepoLocation; //simulate Update button click _view.Raise(v => v.Save += null, EventArgs.Empty); //assert Assert.AreEqual(OtherName, _config.UserName, "Name"); Assert.AreEqual(OtherEmail, _config.EmailAddress, "Email"); Assert.AreEqual(OtherRepoLocation, _config.DefaultRepositoryLocation, "Default Repo Location"); }
public void ChangesToViewAreRevertedOnCancel() { //arrange var presenter = new SettingsPresenter(_view.Object, _configService.Object, _folderBrowserFactory.Object); //simulate user input _view.Object.UserName = OtherName; _view.Object.EmailAddress = OtherEmail; _view.Object.DefaultRepositoryLocation = OtherRepoLocation; //act //simulate Cancel button click _view.Raise(v => v.Cancel += null, EventArgs.Empty); //assert Assert.AreEqual(Name, _view.Object.UserName, "Name"); Assert.AreEqual(Email, _view.Object.EmailAddress, "Email"); Assert.AreEqual(RepoLocation, _view.Object.DefaultRepositoryLocation, "Default Repo Location"); }
public void Start() { _items = GetComponentInChildren <InventoryPresenter>(); _interface = GetComponentInChildren <PauseInterface>(); _presenter = GetComponentInChildren <PausePresenter>(); _settings = GetComponentInChildren <SettingsPresenter>(); _member = GetComponentInChildren <MemberStatPresenter>(); _equipment = GetComponentInChildren <EquipmentPresenter>(); _magic = GetComponentInChildren <MagicPresenter>(); _memberSelect = GetComponentInChildren <MemberSelectPresenter>(); _party = PartyManager.Instance; _controls = ControlManager.Instance; _inventory = InventoryManager.Instance; if (_interface == null) { DebugMessage("Could not find a Pause Interface in the children of " + gameObject.name + "!", LogLevel.Warning); } if (_presenter == null) { DebugMessage("Could not find a Pause Presenter in the children of " + gameObject.name + "!", LogLevel.Warning); } if (_settings == null) { DebugMessage("Could not find a Settings Presenter in the children of " + gameObject.name + "!", LogLevel.Warning); } if (_equipment == null) { DebugMessage("Could not find an Equipment Presenter in the children of " + gameObject.name + "!", LogLevel.Warning); } if (_magic == null) { DebugMessage("Could not find an Magic Presenter in the children of " + gameObject.name + "!", LogLevel.Warning); } }
private void SettingsViewLoad(object sender, EventArgs e) { if (_settingsPresenter == null) { _settingsPresenter = _presentersFactory.CreateSettingsPresenter(this); _settingsViewModel = _settingsPresenter.Initialize(); _serverNameTextBox.Text = _settingsViewModel.ServerAddress; _accountTextBox.Text = _settingsViewModel.Username; _passwordTextBox.Text = _settingsViewModel.Password; _batchSizeTextBox.Text = _settingsViewModel.SynchronizationBatchSize.ToString(CultureInfo.InvariantCulture); _versionValueLabel.Text = _settingsViewModel.Version; _languagesComboBox.DataSource = _settingsPresenter.GetAvailableLanguages(); _languagesComboBox.SelectedItem = _settingsPresenter.GetSelectedLocalization(); _languagesComboBox.SelectedValueChanged += _languagesComboBox_SelectedValueChanged; ViewContainer.RegisterLeftAction(new Save(_settingsPresenter)); ViewContainer.RegisterRightAction(new Cancel(_settingsPresenter)); } }
public SettingsPresenter LoadViewSettings() { if (settingsPresenter == null) { settingsPresenter = new SettingsPresenter(Instance.appParams.getView("Settings"), settingsRepository); } settingsPresenter.InitializeView(MainWindow); return settingsPresenter; }
public Settings() { InitializeComponent(); presenter = new SettingsPresenter(this); }
public AddReferenceCommand(SettingsPresenter presenter, NewReferenceWindow window) { this.presenter = presenter; this.window = window; }
private void frmMain_Load(object sender, EventArgs e) { setPresenter = new SettingsPresenter(this); linkPresenter = new LinkgrabberPresenter(this); dlPresenter = new DownloaderPresenter(this); listViewDL.View = View.Details; listViewDL.FullRowSelect = true; listViewDL.Columns.Add("Filename", -2, HorizontalAlignment.Left); listViewDL.Columns.Add("Status", -2, HorizontalAlignment.Left); listViewDL.Columns.Add("Progress", -2, HorizontalAlignment.Left); listViewDL.Columns.Add("Filesize", -2, HorizontalAlignment.Left); listViewDL.Columns.Add("FileURL", -2, HorizontalAlignment.Left); }
public SettingsDebug(SettingsPresenter presenter, ISettingsRepository model) { this.presenter = presenter; this.model = model; model.PropertyChanged += new PropertyChangedEventHandler(model_PropertyChanged); }
public Save(SettingsPresenter presenter) { _presenter = presenter; }
public RemoveReferenceCommand(SettingsPresenter presenter) { this.presenter = presenter; }
public Cancel(SettingsPresenter presenter) { _presenter = presenter; }