public LoginController(IEventAggregator eventAggregator, IRegionManager regionManager, ILoginView view, ILinqApi api, ICredentialsStore store, IAsyncManager manager) { eventAggregator.GetEvent<InitialViewActivatedEvent>().Subscribe( DoLogin); this.region = regionManager.Regions[RegionNames.DialogRegion]; this.eventAggregator = eventAggregator; this.view = view; this.api = api; this.store = store; this.manager = manager; this.region.Add(this.view); this.username = store.Username; this.password = store.Password; this.view.DataContext = this; this.provideCredentialsCommand = new DelegateCommand<object>(this.ProvideCredentials, o => !(String.IsNullOrEmpty(this.Username) || String.IsNullOrEmpty(this.Password))); }
public void SetUp() { _view = Substitute.For<ILoginView>(); _clientMessenger = Substitute.For<IClientMessenger>(); _uut = new LoginViewController(_view, _clientMessenger); _view.Controller = _uut; }
public LoginPresenter(ILoginView view) { loginView = view; loginModel = new LoginModel(); loginView.Login += LoginView_Login; }
public LoginPresenter(ILoginView view, ILoginLogic logic, IPreferencesLogic preferencesLogic, IUpdateCheckLogic updateCheckLogic) { this._view = view; this._logic = logic; this._preferencesLogic = preferencesLogic; this._updateCheckLogic = updateCheckLogic; }
public LoginPresenter(ILoginView view, IChatHubProxy proxy, INavigationService navigationService) { _view = view; _proxy = proxy; _navigationService = navigationService; _view.PropertyChanged += (s, e) => _view.SetLoginEnabled(proxy.IsConnected && !_isLoggingIn && !String.IsNullOrWhiteSpace(_view.UserName)); _view.Login += _view_Login; _proxy.Connected = (detail, details) => { }; Action connect = async () => { _isLoggingIn = true; try { await proxy.Connect(); } finally { _isLoggingIn = false; } }; connect.Invoke(); }
public LoginViewModel(ILoginView view, CompositionContainer shellContainer, IEventAggregator eventAggregator) { this.View = view; this.View.ViewModel = this; this.ShellContainer = shellContainer; this.EventAggregator = eventAggregator; LoginCommand = new CommandHandler<object, object>(OnLogin); }
protected override void Before_each_spec() { _presenter = Create<LoginPresenter>(); _view = Mock<ILoginView>(); _presenter.View = _view; var mockContainer = Mock<IWindsorContainer>(); Locator.Initialize(mockContainer); SetupResult.For(mockContainer.Resolve<IWorkItemDispatcher>()).Return(new SynchronousDispatcher()); }
public LoginViewModel(ILoginView view) { View = view; View.ViewModel = this; ViewDispatcher = ((ILoginView)View).ViewDispatcher; LoginCommand = new CommandHandler<object, object>(LoginCommandAction); CloseCommand = new CommandHandler<object, object>(CloseCommandExecute); //DbHandler.Instance.SaveUserData(new User { Username = "******", Password = "******", Fullname = "Administrator", Address = "Dhaka", UserId = 1 }); }
public LoginController(ILoginView loginView) { this.loginView = loginView; this.loginView.OnLogin += loginView_OnLogin; this.loginView.OnPrinterChanged += loginView_OnPrinterChanged; this.loginView.OnUseCashdrawerChanged += loginView_OnCashdrawerChanged; this.loginView.OnIsFullScreenChanged += loginView_OnIsFullScreenChanged; initSetting(); }
public void SetUp() { _controller = Substitute.For<IApplicationController>(); _view = Substitute.For<ILoginView>(); var service = Substitute.For<ILoginService>(); service.Login(Arg.Any<User>()) .Returns(info => info.Arg<User>().Name == "admin" && info.Arg<User>().Password == "password"); var presenter = new LoginPresenter(_controller, _view, service); presenter.Run(); }
public LoginViewModel(ILoginView view, IEnumerable<IPresentationViewModel> presentationViewModels, Jira.REST.Jira jira, ScreenViewModel screenViewModel) { View = view; Name = "Login"; Page = Pages.Login; _jira = jira; _presentationViewModels = presentationViewModels; _screenViewModel = screenViewModel; AddCommandsHandlers(); }
public LogInViewModel(ILoginView view) { accountService = AppData.Container.Resolve <IAccountService>(); dataService = AppData.Container.Resolve <IDataService>(); this.Museum = new Museum() { Login = "******", Password = "******" }; this.View = view; this.View.BindDataContext(this); }
public void SetUp() { _controller = Substitute.For <IApplicationController>(); _view = Substitute.For <ILoginView>(); var service = Substitute.For <ILoginService>(); service.Login(Arg.Any <User>()) .Returns(info => info.Arg <User>().Name == "admin" && info.Arg <User>().Password == "password"); var presenter = new LoginPresenter(_controller, _view, service); presenter.Run(); }
public void Initialize(ILoginView IloginView, string tokenKey) { this.IloginView = IloginView; if (tokenKey != null) { CheckUserAuthentication(true); } else { CheckUserAuthentication(false); } }
public LoginPresenter(ILoginView view, Constants.UserRole role) { User user = new User(); _business = new UserBusiness(Singleton <PosEngine> .Instance.Resolve <IRepository <User> >()); _view = view; _model = new LoginModel(user); _model.Role = role.ToString(); _view.InitView(_model); //_model.UserName = "******"; //_model.Password = "******"; }
private void CreateAndSubscribeToLoginWindow() { loginView = UICreator .GetInstance() .Create <LoginWindow>(); if (loginView != null) { loginView.LoginButtonClicked += OnLoginButtonClicked; loginView.CreateAccountButtonClicked += OnCreateAccountButtonClicked; } }
public void SetUp() { _controller = Substitute.For <IApplicationController>(); _view = Substitute.For <ILoginView>(); // заглушка для представления _messageService = Substitute.For <IMessageService>(); var service = Substitute.For <ILoginService>(); // заглушка для сервиса // авторизуется только пользователь admin/password service.Login(Arg.Any <User>()) .Returns(info => info.Arg <User>().Name == "admin" && info.Arg <User>().Password == "password"); var presenter = new LoginPresenter(_controller, _view, service, _messageService); presenter.Run(); }
public LoginPresenter( ILoginView view, IErrorView errorView, IDatabaseService databaseService, IAuthService authService, ISettingsService settingsService, IBackgroundTaskFactory backgroundTaskFactory) { _view = view; _errorView = errorView; _databaseService = databaseService; _authService = authService; _settingsService = settingsService; _backgroundTaskFactory = backgroundTaskFactory; }
public MainForm(User user, ILoginView _view) { InitializeComponent(); _loginForm = _view as Form; _presenter = new MainPresenter(this, user); InvokeInitialize(new EventArgs()); FormClosed += OnMainFormFormClosed; MainTabControl.TabIndexChanged += OnTabIndexChanged; MainTabControl.SelectedIndexChanged += SelectedIndexChanged; }
public SourceControlPresenter( VBE vbe, AddIn addin, IConfigurationService<SourceControlConfiguration> configService, ISourceControlView view, IChangesPresenter changesPresenter, IBranchesPresenter branchesPresenter, ISettingsPresenter settingsPresenter, IUnsyncedCommitsPresenter unsyncedPresenter, IFolderBrowserFactory folderBrowserFactory, ISourceControlProviderFactory providerFactory, IFailedMessageView failedMessageView, ILoginView loginView ) : base(vbe, addin, view) { _configService = configService; _config = _configService.LoadConfiguration(); _changesPresenter = changesPresenter; _changesPresenter.ActionFailed += OnActionFailed; _branchesPresenter = branchesPresenter; _branchesPresenter.ActionFailed += OnActionFailed; _settingsPresenter = settingsPresenter; _settingsPresenter.ActionFailed += OnActionFailed; _unsyncedPresenter = unsyncedPresenter; _unsyncedPresenter.ActionFailed += OnActionFailed; _folderBrowserFactory = folderBrowserFactory; _providerFactory = providerFactory; _branchesPresenter.BranchChanged += _branchesPresenter_BranchChanged; _loginView = loginView; _loginView.Confirm += _loginView_Confirm; _failedMessageView = failedMessageView; _failedMessageView.DismissSecondaryPanel += DismissSecondaryPanel; _view = view; _view.SecondaryPanel = _failedMessageView; _view.RefreshData += OnRefreshChildren; _view.OpenWorkingDirectory += OnOpenWorkingDirectory; _view.InitializeNewRepository += OnInitNewRepository; }
public SourceControlPresenter( VBE vbe, AddIn addin, IConfigurationService <SourceControlConfiguration> configService, ISourceControlView view, IChangesPresenter changesPresenter, IBranchesPresenter branchesPresenter, ISettingsPresenter settingsPresenter, IUnsyncedCommitsPresenter unsyncedPresenter, IFolderBrowserFactory folderBrowserFactory, ISourceControlProviderFactory providerFactory, IFailedMessageView failedMessageView, ILoginView loginView ) : base(vbe, addin, view) { _configService = configService; _config = _configService.LoadConfiguration(); _changesPresenter = changesPresenter; _changesPresenter.ActionFailed += OnActionFailed; _branchesPresenter = branchesPresenter; _branchesPresenter.ActionFailed += OnActionFailed; _settingsPresenter = settingsPresenter; _settingsPresenter.ActionFailed += OnActionFailed; _unsyncedPresenter = unsyncedPresenter; _unsyncedPresenter.ActionFailed += OnActionFailed; _folderBrowserFactory = folderBrowserFactory; _providerFactory = providerFactory; _branchesPresenter.BranchChanged += _branchesPresenter_BranchChanged; _loginView = loginView; _loginView.Confirm += _loginView_Confirm; _failedMessageView = failedMessageView; _failedMessageView.DismissSecondaryPanel += DismissSecondaryPanel; _view = view; _view.SecondaryPanel = _failedMessageView; _view.RefreshData += OnRefreshChildren; _view.OpenWorkingDirectory += OnOpenWorkingDirectory; _view.InitializeNewRepository += OnInitNewRepository; }
private void View_LoginClicked(ILoginView sender) { try { LoggedInUser = repository.FindUserByLoginAndPassword(sender.LoginName, sender.Password); sender.OnSuccessfullLogin(); } catch (UserNotFoundException ex) { sender.ShowIncorretUserError(); } catch (Exception ex) { sender.ShowConnectionError(); } }
public LoginViewPresenter(ILoginView loginFrm, ITraderModel trader) { LoginView = loginFrm; Trader = trader; LoginView.LoginStart += LoginView_LoginStart; LoginView.BrokerSelectionChange += LoginView_BrokerSelectionChange; LoginView.Brokers = Trader.Brokers.Keys; LoginView.TdFrontConnected = false; LoginView.MdFrontConnected = false; LoginView.TradeFrontMsg = "请选择接入商"; LoginView.MarketFrontMsg = "请选择接入商"; Trader.eventFrontConnected += Trader_FrontConnected; Trader.eventUserLogined += Trader_UserLogined; }
/// <summary> /// Constructor /// </summary> /// <param name="view">Related view</param> public LoginPresenter(ILoginView view) { string url = string.Empty; string userName = string.Empty; string password = string.Empty; if (_view != null) { url = _view.ServerDomain; } _view = view; if (string.IsNullOrEmpty(_view.ServerDomain)) { _view.ServerDomain = url; } _view.Load += View_Load; _dispatcher = ServiceLocator.GetDispatcher(); }
public LoginViewModel(ILoginView view) { View = view; View.ViewModel = this; LoginCommand = new CommandHandler<object, object>(LoginCommandAction); CloseCommand = new CommandHandler<object, object>(CloseCommandAction); //DbHandler.Instance.SaveUserData(new User //{ // UserId = 1, // Username = "******", // Password = "******", // Fullname = "Administrator of POS", // Address = "Dhaka", // DateOfBirth = new DateTime(1990, 1, 1), // Email = "*****@*****.**" //}); CheckedLanguageCommand = new CommandHandler<object, object>(CheckedLanguageCommandExecute); var _cultureCollection = LocaleManager.DefaultCultureCollection; _cultureCollection.Where(c => c.CultureCode.Equals(Thread.CurrentThread.CurrentUICulture.Name)).ToList().ForEach(p => p.IsChecked = true); CultureCollection = _cultureCollection; }
public LoginInteractor(ILoginView view, ILoginPage page) { _view = view; _page = page; }
public LoginPresenter(ILoginView view, ILoginRepository repository) { _view = view; view.Presenter = this; _repository = repository; }
public LoginPresenter(ILoginView loginView) { this.loginView = loginView; }
public void SetUp() { controller = Substitute.For <IApplicationController>(); view = Substitute.For <ILoginView>(); service = Substitute.For <ILoginService>(); }
public LoginController(ILoginView loginView) { this.loginView = loginView; }
public LoginPresenter(ILoginView loginView) { _loginView = loginView; userService = new UserService(); }
private readonly ILog _logger = LogManager.GetLogger(Constants.CONF_ID_LOGGER); //log4net _logger public LoginPresenter(ILoginView loginView) { _loginView = loginView; }
public LoginPresenter(ILoginView param) { view = param; }
public LoginViewController(ILoginView view, IClientMessenger clientMessenger = null) { _view = view; _clientMessenger = clientMessenger; }
public LoginViewModel(ILoginView view) { View = view; View.ViewModel = this; LoginCommand = new CommandHandler<object, object>(LoginCommandAction); CloseCommand = new CommandHandler<object, object>(CloseCommandAction); CheckedLanguageCommand = new CommandHandler<object, object>(CheckedLanguageCommandExecute); var _cultureCollection = LocaleManager.DefaultCultureCollection; _cultureCollection.Where(c => c.CultureCode.Equals(Thread.CurrentThread.CurrentUICulture.Name)).ToList().ForEach(p => p.IsChecked = true); CultureCollection = _cultureCollection; }
public void SetUp() { _view = MockRepository.GenerateMock<ILoginView>(); _loginService = MockRepository.GenerateMock<ILoginService>(); _presenter = new LoginPresenter(_view,_loginService); }
public LoginPresenter(ILoginView loginView, ILoginModel loginModel) { _loginView = loginView; _loginModel = loginModel; }
public LoginPresenter(ILoginView view) { _view = view; }
public LoginPresenter(ILoginView view) { this.view = view; this.view.LoginTrigger += LoginHandler; this.view.RegisterTrigger += RegisterHandler; }
public override void prompt(Protocol protocol, Credentials credentials, String title, String reason, bool enableKeychain, bool enablePublicKey, bool enableAnonymous) { _view = ObjectFactory.GetInstance<ILoginView>(); InitEventHandlers(); _protocol = protocol; _credentials = credentials; _enableKeychain = enableKeychain; _enablePublicKey = enablePublicKey;// _enableAnonymous = enableAnonymous; _view.Title = Locale.localizedString(title, "Credentials"); _view.Message = Locale.localizedString(reason, "Credentials"); _view.Username = credentials.getUsername(); _view.UsernameLabel = protocol.getUsernamePlaceholder() + ":"; _view.PasswordLabel = protocol.getPasswordPlaceholder() + ":"; _view.SavePasswordState = Preferences.instance().getBoolean("connection.login.useKeychain") && Preferences.instance().getBoolean("connection.login.addKeychain"); _view.DiskIcon = IconCache.Instance.IconForName(_protocol.disk(), 64); Update(); AsyncController.AsyncDelegate d = delegate { if (DialogResult.Cancel == _view.ShowDialog(_browser.View)) { throw new LoginCanceledException(); } credentials.setSaved(_view.SavePasswordState); credentials.setUsername(Utils.SafeString(_view.Username)); credentials.setPassword(Utils.SafeString(_view.Password)); }; _browser.Invoke(d); }
protected override void Before_each_spec() { _presenter = Create<LoginPresenter>(); _view = Mock<ILoginView>(); _presenter.View = _view; SetupResult.For(_view.Username).Return("dave"); SetupResult.For(_view.Password).Return("test123"); SetupResult .For(Get<IAuthenticationService>().Authenticate("dave", "test123")) .Return(false); var mockContainer = Mock<IWindsorContainer>(); Locator.Initialize(mockContainer); SetupResult.For(mockContainer.Resolve<IWorkItemDispatcher>()).Return(new SynchronousDispatcher()); }
public LoginMediator(ILoginView view) : base(view) { this.Target = view; }
public LoginPresenter(ILoginView view) { _view = view; _repository = new LoginRepository(); }
public LoginPresenter(IAccountRepository accountRepository, ILoginView loginView) { _accountRepository = accountRepository; _view = loginView; }
public LoginPresenter(ILoginView view) { this.view = view; }
// Life Cycle public LoginViewController(ILoginView view) { this._view = view; }
public LoginViewModel(ILoginView view) { _view = view; LogonCommand = new RelayCommand(Logon, p => CanLogon()); }
private LoginController(WindowController c) { _view = ObjectFactory.GetInstance <ILoginView>(); _browser = c; InitEventHandlers(); }
public LoginPresenter(ILoginView view, IUserRepository userRepository) { _view = view; _view.LoginPresenter = this; _userRepository = userRepository; }
public LoginPresenter(ILoginView loginView) { LoginView = loginView; LoginView.Submit += LoginView_Submit; }
public LoginPresenter(ILoginView view){ this.view = view; }
public void Login() { _loginView = this.WorkItem.SmartParts.AddNew <LoginView>(); _shellWorkspace.Show(_loginView); }
public LoginPresenter(ILoginView loginView, ILogger logger) { //_mainForm = mainForm; _logger = logger; _loginView = loginView; }
public LoginPresenter(ILoginView view, IUserState userState) { _view = view; _userState = userState; }
public LoginRespone(ILoginView view) { this.view = view; }
public void SetView(IView view) { if (view is ILoginView) { _view = (ILoginView)view; } else { string message = string.Format(@"Przekazano nieodpowiedni widok, oczekiwano widoku typu {0} a podano {1} ", typeof(ILoginView), view.GetType().ToString()); throw new ArgumentException(message); } }
public LoginPresenter(ILoginView loginView) { _loginView = loginView; _loginModel = new LoginModel(); }
public static LoginPresenter LoginPresenter(ILoginView view) { return new LoginPresenter(view, UserState); }