public static string GetUserColor(User user) { // retrieve category name of the user associated with the given tweet var config = _config.Where(keyValue => keyValue.Value.Where(userName => userName.Equals(user.ScreenName, StringComparison.InvariantCultureIgnoreCase) ).Count() > 0 ).FirstOrDefault(); if (null != config.Key && null != config.Value) { return _colors[config.Key]; } // can't find user, return default color return DEFAULT_TWEET_COLOR; }
private void ShowAlert(string message, User user) { _notififcation.Message = message; _notififcation.User = user; _notififcation.Left = SystemParameters.PrimaryScreenWidth - _notififcation.Width; _notififcation.Top = SystemParameters.PrimaryScreenHeight - _notififcation.Height; _notififcation.Show(); }
string GetDirectMessageBodyFromText(User user, string text) { string expression = string.Format(@"{0}\s*{1}\s+(.*)", Constants.DIRECT_MESSAGE_PREFIX, user.ScreenName); Regex regex = new Regex(expression); Match match = regex.Match(text); return match.Groups[1].Value; }