Example #1
0
        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;
 }
Example #5
0
        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);
 }
Example #7
0
 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 });
 }
Example #9
0
 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();
        }
Example #12
0
 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);
 }
Example #13
0
        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();
        }
Example #14
0
        public void Initialize(ILoginView IloginView, string tokenKey)
        {
            this.IloginView = IloginView;

            if (tokenKey != null)
            {
                CheckUserAuthentication(true);
            }
            else
            {
                CheckUserAuthentication(false);
            }
        }
Example #15
0
        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 = "******";
        }
Example #16
0
        private void CreateAndSubscribeToLoginWindow()
        {
            loginView = UICreator
                        .GetInstance()
                        .Create <LoginWindow>();

            if (loginView != null)
            {
                loginView.LoginButtonClicked +=
                    OnLoginButtonClicked;
                loginView.CreateAccountButtonClicked +=
                    OnCreateAccountButtonClicked;
            }
        }
Example #17
0
        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();
        }
Example #18
0
 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;
 }
Example #19
0
 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;
 }
Example #20
0
        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();
            }
        }
Example #24
0
        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;
        }
Example #25
0
        /// <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();
        }
Example #26
0
 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;
 }
Example #28
0
 public LoginPresenter(ILoginView view, ILoginRepository repository)
 {
     _view          = view;
     view.Presenter = this;
     _repository    = repository;
 }
Example #29
0
 public LoginPresenter(ILoginView loginView)
 {
     this.loginView = loginView;
 }
Example #30
0
 public void SetUp()
 {
     controller = Substitute.For <IApplicationController>();
     view       = Substitute.For <ILoginView>();
     service    = Substitute.For <ILoginService>();
 }
 public LoginController(ILoginView loginView)
 {
     this.loginView = loginView;
 }
Example #32
0
 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;
	}
Example #34
0
 public LoginPresenter(ILoginView param)
 {
     view = param;
 }
Example #35
0
 public LoginViewController(ILoginView view, IClientMessenger clientMessenger = null)
 {
     _view = view;
     _clientMessenger = clientMessenger;
 }
Example #36
0
 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;
 }
Example #39
0
 public LoginPresenter(ILoginView view)
 {
     _view = view;
 }
Example #40
0
 public LoginPresenter(ILoginView view)
 {
     this.view = view;
     this.view.LoginTrigger    += LoginHandler;
     this.view.RegisterTrigger += RegisterHandler;
 }
Example #41
0
        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);
        }
Example #42
0
        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;
 }
Example #44
0
 public LoginPresenter(ILoginView view)
 {
     _view       = view;
     _repository = new LoginRepository();
 }
Example #45
0
 public LoginPresenter(IAccountRepository accountRepository, ILoginView loginView)
 {
     _accountRepository = accountRepository;
     _view = loginView;
 }
Example #46
0
 public LoginPresenter(ILoginView view)
 {
     this.view = view;
 }
Example #47
0
        // Life Cycle

        public LoginViewController(ILoginView view)
        {
            this._view = view;
        }
 public LoginViewModel(ILoginView view)
 {
     _view = view;
     LogonCommand = new RelayCommand(Logon, p => CanLogon());
 }
Example #49
0
 private LoginController(WindowController c)
 {
     _view    = ObjectFactory.GetInstance <ILoginView>();
     _browser = c;
     InitEventHandlers();
 }
Example #50
0
 public LoginPresenter(ILoginView view, IUserRepository userRepository)
 {
     _view = view;
     _view.LoginPresenter = this;
     _userRepository      = userRepository;
 }
Example #51
0
 public LoginPresenter(ILoginView loginView)
 {
     LoginView         = loginView;
     LoginView.Submit += LoginView_Submit;
 }
Example #52
0
	public LoginPresenter(ILoginView view){
		this.view = view;

	}
 public LoginInteractor(ILoginView view, ILoginPage page)
 {
     _view = view;
     _page = page;
 }
Example #54
0
 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;
 }
Example #57
0
 public LoginRespone(ILoginView view)
 {
     this.view = view;
 }
Example #58
0
 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);
     }
 }
Example #59
0
 public LoginPresenter(ILoginView loginView)
 {
     _loginView  = loginView;
     _loginModel = new LoginModel();
 }
 public static LoginPresenter LoginPresenter(ILoginView view)
 {
     return new LoginPresenter(view, UserState);
 }