Esempio n. 1
0
        public EditAccount(IAccountContainer container, TwitterAccount account, bool pushing)
        {
            var  info       = new AccountInfo();
            bool newAccount = account == null;

            if (newAccount)
            {
                account = new TwitterAccount();
            }
            else
            {
                info.Login = account.Username;
                //info.Password = account.Password;
            }

            var bc  = new BindingContext(this, info, Locale.GetText("Edit Account"));
            var dvc = new DialogViewController(bc.Root, true);

            PushViewController(dvc, false);
            UIBarButtonItem done = null;

            done = new UIBarButtonItem(UIBarButtonSystemItem.Done, delegate {
                bc.Fetch();

                done.Enabled = false;
                CheckCredentials(info, delegate(string errorMessage) {
                    Util.PopNetworkActive();
                    done.Enabled = true;

                    if (errorMessage == null)
                    {
                        account.Username = info.Login;
                        //account.Password = info.Password;

                        lock (Database.Main){
                            if (newAccount)
                            {
                                Database.Main.Insert(account);
                            }
                            else
                            {
                                Database.Main.Update(account);
                            }
                        }

                        account.SetDefaultAccount();
                        DismissModalViewControllerAnimated(true);
                        container.Account = account;
                    }
                    else
                    {
                        dlg = new UIAlertView(Locale.GetText("Login error"), errorMessage, null, Locale.GetText("Close"));
                        dlg.Show();
                    }
                });
            });

            dvc.NavigationItem.SetRightBarButtonItem(done, false);
        }
Esempio n. 2
0
 public ImageController(IAccountContainer accountContainer, IImageContainer imageContainer,
                        IBlobContainer blobContainer, IMessagingClient messagingClient)
 {
     this.AccountContainer = accountContainer;
     this.ImageContainer   = imageContainer;
     this.BlobContainer    = blobContainer;
     this.MessagingClient  = messagingClient;
 }
 public MedicalViewModel(INavigationService navigationService, IAccountContainer accountContainer, MedicalChangeStatus.MedicalChangeStatusViewModel medicalChangeStatusViewModel, MedicalLoginViewModel medicalLoginViewModel)
     : base(navigationService)
 {
     _accountContainer            = accountContainer;
     MedicalChangeStatusViewModel = medicalChangeStatusViewModel;
     MedicalLoginViewModel        = medicalLoginViewModel;
     AttachComponent(MedicalChangeStatusViewModel, MedicalLoginViewModel);
 }
Esempio n. 4
0
 public AuthenticationInfoService(
     IUserProfileContainer userProfileContainer,
     IAccountContainer accountContainer,
     ISessionContainer sessionContainer,
     IMetadataContainer metadataContainer,
     ILoggerFactory loggerFactory)
 {
     _userProfileContainer = userProfileContainer;
     _accountContainer     = accountContainer;
     _sessionContainer     = sessionContainer;
     _metadataContainer    = metadataContainer;
     _logger = loggerFactory.CreateLogger <AuthenticationInfoService>();
 }
Esempio n. 5
0
 public MedicalAuthenticationService(
     IPlatformClient client,
     IAccountContainer accountContainer,
     ILoggerFactory loggerFactory,
     IConnectivityService connectivityService,
     IMedicalAuthenticationServiceErrorHandler serviceErrorHandler)
 {
     _client              = client;
     _accountContainer    = accountContainer;
     _connectivityService = connectivityService;
     _serviceErrorHandler = serviceErrorHandler;
     _logger              = loggerFactory.CreateLogger <MedicalAuthenticationService>();
 }
Esempio n. 6
0
        public EditAccount(IAccountContainer container, TwitterAccount account, bool pushing)
        {
            var info = new AccountInfo ();
            bool newAccount = account == null;

            if (newAccount)
                account = new TwitterAccount ();
            else {
                info.Login = account.Username;
                //info.Password = account.Password;
            }

            var bc = new BindingContext (this, info, Locale.GetText ("Edit Account"));
            var dvc = new DialogViewController (bc.Root, true);
            PushViewController (dvc, false);
            UIBarButtonItem done = null;
            done = new UIBarButtonItem (UIBarButtonSystemItem.Done, delegate {
                bc.Fetch ();

                done.Enabled = false;
                CheckCredentials (info, delegate (string errorMessage) {
                    Util.PopNetworkActive ();
                    done.Enabled = true;

                    if (errorMessage == null){
                        account.Username = info.Login;
                        //account.Password = info.Password;

                        lock (Database.Main){
                            if (newAccount)
                                Database.Main.Insert (account);
                            else
                                Database.Main.Update (account);
                        }

                        account.SetDefaultAccount ();
                        DismissModalViewControllerAnimated (true);
                        container.Account = account;
                    } else {
                        dlg = new UIAlertView (Locale.GetText ("Login error"), errorMessage, null, Locale.GetText ("Close"));
                        dlg.Show ();
                    }
                });
            });

            dvc.NavigationItem.SetRightBarButtonItem (done, false);
        }
Esempio n. 7
0
 public UserService(
     IPlatformClient platformClient,
     IUserProfileContainer userProfileContainer,
     IMetadataContainer metadataContainer,
     ILoggerFactory loggerFactory,
     IErrorResponseHandler serviceErrorHandler,
     IConnectivityService connectivityService,
     IAccountContainer accountContainer)
 {
     _platformClient       = platformClient;
     _userProfileContainer = userProfileContainer;
     _metadataContainer    = metadataContainer;
     _serviceErrorHandler  = serviceErrorHandler;
     _connectivityService  = connectivityService;
     _accountContainer     = accountContainer;
     _logger = loggerFactory.CreateLogger <UserService>();
 }
 public AccountServiceController()
 {
     objAccount = new AccountServiceContainer();
 }
Esempio n. 9
0
 public AccountController(IAccountContainer accountContainer)
 {
     this.AccountContainer = accountContainer;
 }