Exemplo n.º 1
0
        public MessageList GetMessages(string sender, string afterIdStr, string afterTimestampStr,
                                       string getSentStr, string getReceivedStr, string maxResultsStr)
        {
            int?afterId    = IntUtils.ParseN(afterIdStr);
            int?maxResults = IntUtils.ParseN(maxResultsStr);

            using (var connection = GetConnection())
            {
                var token    = GetToken(connection);
                var messages = connection.MessageService.GetMessages(
                    token,
                    BoolUtils.ParseN(getSentStr) ?? true,
                    BoolUtils.ParseN(getReceivedStr) ?? true,
                    sender,
                    afterId,
                    DateUtils.FromMilisN(afterTimestampStr),
                    maxResults);
                var list = new MessageList(messages, token.User.Username);
                return(list);
            }
        }
Exemplo n.º 2
0
 protected override object ConvertCore(object value, Type targetType, object parameter, CultureInfo culture)
 {
     return(targetType == typeof(bool) ? BoolUtils.ImplicitConvertFrom(value) : value);
 }