Beispiel #1
0
 public void Logout()
 {
     LoggedIn               = false;
     this.apiClient         = new IssueManagerClientUser(this.state.Host);
     this.state.AccessToken = string.Empty;
     SaveState();
 }
Beispiel #2
0
 public AppIssueClient()
 {
     LastErrorText    = string.Empty;
     FilteringChanged = false;
     Initilized       = false;
     LoggedIn         = false;
     apiClient        = new IssueManagerClientUser(Defaulthost);
     state            = new IssueManagerState();
     filtering        = new FilteringAndSorting();
 }
Beispiel #3
0
        public bool Login(string host, string username, string password)
        {
            LoggedIn = false;

            this.apiClient = new IssueManagerClientUser(host);
            this.apiClient.Login(username, password);

            // Store the userinformation for next time
            this.state.Host        = host;
            this.state.Username    = username;
            this.state.AccessToken = this.apiClient.AccessToken;
            SaveState();
            LoggedIn = true;

            return(true);
        }
Beispiel #4
0
        private void ImpersonateUser_Click(object sender, RoutedEventArgs e)
        {
            try
            {
                var vm = ShowInputWindow(new User {
                    UserName = "******"                         /*"Piledal"*/
                });
                if (vm != null)
                {
                    var token = _applicationClient.GetTokenForUser(vm.UserName);
                    SetResultSuccess(token);

                    _userClient = new IssueManagerClientUser(Host, token);
                }
            }
            catch (Exception ex)
            {
                SetResultError("GetTokenForUser failed with result: " + ex.GetType());
            }
        }
Beispiel #5
0
        public async Task <bool> Init()
        {
            await Task.Run(async() =>
            {
                IFileHelper service = DependencyService.Get <IFileHelper>();

                string content = await service.Load("Filtering.dat");
                if (content.Length > 0)
                {
                    this.filtering = JsonConvert.DeserializeObject <FilteringAndSorting>(content);
                }
                else
                {
                    this.filtering.SetDefault();
                }

                content = await service.Load("AppState.dat");
                if (content.Length > 0)
                {
                    this.state = JsonConvert.DeserializeObject <IssueManagerState>(content);

                    if (this.state.Host.Length == 0)
                    {
                        this.state.Host = Defaulthost;
                    }

                    this.apiClient = new IssueManagerClientUser(this.state.Host, this.state.AccessToken);
                    LoggedIn       = this.state.AccessToken.Length > 0;
                }

                Initilized = true;
                SaveState();
                return(true);
            });

            return(false);
        }