Esempio n. 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);
                }
            }
        }
Esempio n. 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);
Esempio n. 4
0
 public static TwitterDirectMessage[] ParseJsonArray(string json)
 => MyCommon.CreateDataFromJson <TwitterDirectMessage[]>(json);
Esempio n. 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);
Esempio n. 8
0
 /// <exception cref="SerializationException"/>
 public static TwitterConfiguration ParseJson(string json)
 {
     return(MyCommon.CreateDataFromJson <TwitterConfiguration>(json));
 }
Esempio n. 9
0
 /// <exception cref="SerializationException"/>
 public static TwitterStatusCompat[] ParseJsonArray(string json)
 {
     return(MyCommon.CreateDataFromJson <TwitterStatusCompat[]>(json));
 }
Esempio n. 10
0
 /// <exception cref="SerializationException"/>
 public static TwitterStreamEvent ParseJson(string json)
 {
     return(MyCommon.CreateDataFromJson <TwitterStreamEvent>(json));
 }
Esempio n. 11
0
 /// <exception cref="SerializationException"/>
 public static TwitterUploadMediaInit ParseJson(string json)
 => MyCommon.CreateDataFromJson <TwitterUploadMediaInit>(json);
Esempio n. 12
0
 /// <exception cref="SerializationException"/>
 public static TwitterFriendship ParseJson(string json)
 {
     return(MyCommon.CreateDataFromJson <TwitterFriendship>(json));
 }
Esempio n. 13
0
 /// <exception cref="SerializationException"/>
 public static TwitterUploadMediaResult ParseJson(string json)
 {
     return(MyCommon.CreateDataFromJson <TwitterUploadMediaResult>(json));
 }
Esempio n. 14
0
 public static TwitterRateLimits ParseJson(string json)
 => MyCommon.CreateDataFromJson <TwitterRateLimits>(json);
Esempio n. 15
0
 public static TwitterList ParseJson(string json)
 => MyCommon.CreateDataFromJson <TwitterList>(json);
Esempio n. 16
0
 /// <exception cref="SerializationException"/>
 public static TwitterDirectMessage ParseJson(string json)
 {
     return(MyCommon.CreateDataFromJson <TwitterDirectMessage>(json));
 }
Esempio n. 17
0
 public static TwitterList[] ParseJsonArray(string json)
 => MyCommon.CreateDataFromJson <TwitterList[]>(json);
Esempio n. 18
0
 public static TwitterSearchResult ParseJson(string json)
 => MyCommon.CreateDataFromJson <TwitterSearchResult>(json);