Beispiel #1
0
        private async Task CreateCredentials()
        {
            var readablePass = PasswordInput.ToStandardString();

            if (String.IsNullOrEmpty(ServerNameInput) || String.IsNullOrEmpty(UserNameInput) || String.IsNullOrEmpty(readablePass))
            {
                IoC.Get <IAlertService>().Show("Fill all fields!");
                return;
            }

            UnauthorizedCredentials = new FTPcredentialsModel(ServerNameInput, UserNameInput, PasswordInput);

            if (await Authorize())
            {
                AuthorizedCredentials.Add(UnauthorizedCredentials);
                ClientModel = new FTPclientModel(AuthorizedCredentials.LastOrDefault()); //TODO IoC container
                List <string> response = await ClientModel.FtpGetAllFilesAsync();

                IoC.Get <RemoteExplorerControlVM>().GetItemsFromResponse(response);
                IoC.Get <RemoteExplorerControlVM>().CurrentPath = ClientModel.Uri;
            }

            else
            {
                IoC.Get <IAlertService>().Show("Incorrect credentials!");
            }
        }