示例#1
0
        public async Task <T> LoadJsonAsync()
        {
            if (this.completed)
            {
                return(this.instance);
            }

            using (var content = this.Response.Content)
            {
                var responseText = await content.ReadAsStringAsync()
                                   .ConfigureAwait(false);

                try
                {
                    this.instance  = MyCommon.CreateDataFromJson <T>(responseText);
                    this.completed = true;

                    return(this.instance);
                }
                catch (SerializationException ex)
                {
                    throw TwitterApiException.CreateFromException(ex, responseText);
                }
            }
        }
示例#2
0
 /// <exception cref="SerializationException"/>
 public static TwitterError ParseJson(string json)
 {
     return(MyCommon.CreateDataFromJson <TwitterError>(json));
 }
 public static TwitterTextConfiguration ParseJson(string json)
 => MyCommon.CreateDataFromJson <TwitterTextConfiguration>(json);
示例#4
0
 public static TwitterDirectMessage[] ParseJsonArray(string json)
 => MyCommon.CreateDataFromJson <TwitterDirectMessage[]>(json);
示例#5
0
 public static TwitterStatusCompat ParseJson(string json)
 => MyCommon.CreateDataFromJson <TwitterStatusCompat>(json);
 public static StreamMessageDirectMessage ParseJson(string json)
 => MyCommon.CreateDataFromJson <StreamMessageDirectMessage>(json);
 public static StreamMessageScrubGeo ParseJson(string json)
 => MyCommon.CreateDataFromJson <StreamMessageScrubGeo>(json);
示例#8
0
 /// <exception cref="SerializationException"/>
 public static TwitterConfiguration ParseJson(string json)
 {
     return(MyCommon.CreateDataFromJson <TwitterConfiguration>(json));
 }
示例#9
0
 /// <exception cref="SerializationException"/>
 public static TwitterStatusCompat[] ParseJsonArray(string json)
 {
     return(MyCommon.CreateDataFromJson <TwitterStatusCompat[]>(json));
 }
示例#10
0
 /// <exception cref="SerializationException"/>
 public static TwitterStreamEvent ParseJson(string json)
 {
     return(MyCommon.CreateDataFromJson <TwitterStreamEvent>(json));
 }
示例#11
0
 /// <exception cref="SerializationException"/>
 public static TwitterUploadMediaInit ParseJson(string json)
 => MyCommon.CreateDataFromJson <TwitterUploadMediaInit>(json);
示例#12
0
 /// <exception cref="SerializationException"/>
 public static TwitterFriendship ParseJson(string json)
 {
     return(MyCommon.CreateDataFromJson <TwitterFriendship>(json));
 }
 /// <exception cref="SerializationException"/>
 public static TwitterUploadMediaResult ParseJson(string json)
 {
     return(MyCommon.CreateDataFromJson <TwitterUploadMediaResult>(json));
 }
示例#14
0
 public static TwitterRateLimits ParseJson(string json)
 => MyCommon.CreateDataFromJson <TwitterRateLimits>(json);
示例#15
0
 public static TwitterList ParseJson(string json)
 => MyCommon.CreateDataFromJson <TwitterList>(json);
示例#16
0
 /// <exception cref="SerializationException"/>
 public static TwitterDirectMessage ParseJson(string json)
 {
     return(MyCommon.CreateDataFromJson <TwitterDirectMessage>(json));
 }
示例#17
0
 public static TwitterList[] ParseJsonArray(string json)
 => MyCommon.CreateDataFromJson <TwitterList[]>(json);
示例#18
0
 public static TwitterSearchResult ParseJson(string json)
 => MyCommon.CreateDataFromJson <TwitterSearchResult>(json);