public static UserData ConvertFrom(UserInfo userInfo) { var data = new UserData(); data.ID = userInfo.ID; data.ScreenName = userInfo.ScreenName; data.Name = userInfo.Name; data.DefineAs = userInfo.DefineAs; data.Province = userInfo.Province; data.City = userInfo.City; data.Location = userInfo.Location; data.Description = userInfo.Description; data.Url = userInfo.Url; data.ProfileImageUrl = userInfo.ProfileImageUrl; data.Domain = userInfo.Domain; data.Gender = userInfo.Gender; data.FollowersCount = userInfo.FollowersCount; data.FriendsCount = userInfo.FriendsCount; data.StatusesCount = userInfo.StatusesCount; data.FavouritesCount = userInfo.FavouritesCount; data.CreatedAt = userInfo.CreatedAt; data.GeoEnabled = userInfo.GeoEnabled; data.AllowAllActMsg = userInfo.AllowAllActMsg; data.Following = userInfo.Following; data.Verified = userInfo.Verified; if(null != userInfo.LatestStatus) data.LatestStatus = ConvertFrom(userInfo.LatestStatus); return data; }
private void ProcessSuggestionSelected(UserInfo userInfo) { if (null == userInfo) return; suggestionPop.IsOpen = false; var statusText = txbStatus.Text; suspendChangeHandling = true; txbStatus.Text = Regex.Replace(statusText, @"@([^\s@]+?)$", "@" + userInfo.ScreenName + " "); txbStatus.CaretIndex = txbStatus.Text.Length; suspendChangeHandling = false; }