public void DisplayUser(User user)
        {
            SetDefaultFontColor();
            ConsoleWindowRichTextBox.Clear();
            var userDetail = new StringBuilder();

            userDetail.AppendLine("USER INFO");
            userDetail.AppendLine("---------");
            userDetail.AppendLine(string.Format("FirstName: {0}", user.FirstName));
            userDetail.AppendLine(string.Format("LastName: {0}", user.LastName));
            userDetail.AppendLine(string.Format("Email: {0}", user.Email));
            userDetail.AppendLine(string.Format("UserName: {0}", user.UserName));
            userDetail.AppendLine(string.Format("USER ID: {0}", user.Id));

            ConsoleWindowRichTextBox.Text = userDetail.ToString();
        }
Exemplo n.º 2
0
 public Log User(User user)
 {
     if (user != null)
     {
         Tag(user.UserName);
         Tag(user.Email);
     }
     return this;
 }
Exemplo n.º 3
0
 protected void ResetCurrentUser ()
 {
     _currentUser = null;
 }
Exemplo n.º 4
0
        public async Task<User> GetCurrentUserAsync()
        {
            if (Token == null || !Token.UserId.HasValue)
                return null;

            if (_currentUser == null)
            {
                var response = await GetAsync<User>(Token.UserId.Value);
                _currentUser = response.Data;
            }

            return _currentUser;
        }
 public void logSuccessfulNewUser(User user)
 {
     Console.WriteLine(user.UserName + " Successfully Created");
 }
Exemplo n.º 6
0
 void ResetCurrentUser()
 {
     _currentUser = null;
 }
 private async void getUserButton_Click(object sender, EventArgs e)
 {
     var code = new StringBuilder();
     var console = new StringBuilder();
     try
     {
         code.AppendLine("var user = await Client.GetCurrentUserAsync();");
         _user = await Client.GetCurrentUserAsync();
         _codeWindow.DisplayNewCode(code);
         if (_user != null)
         {
             _consoleWindow.DisplayUser(_user);
         }
         else
         {
             console.AppendLine("Failed to retrieve User");
             console.AppendLine("Possible Error:");
             console.AppendLine("1. Application Id is not set");
             console.AppendLine("2. User token is set");
             console.AppendLine("3. Client not started, Click on \"Begin Async\"");
             console.AppendLine("4. Invalid User Token");
             _consoleWindow.DisplayErrorMessage(console.ToString());
         }
     }
     catch (Exception ex)
     {
         _consoleWindow.DisplayErrorMessage("Failed to retrieve User");
         MessageBox.Show(this, @"An exception was thrown by Mojio Client while retrieviing a User\nException Message: " + ex.Message, @"Exception Thrown");
     }
 }