public void GetMethodTypes(string version, Action<int> error, MethodTypesHandler result) { AsyncPostClient.Post(endpoint, RequestGenerator.getMethodTypes(version), (res) => { ResultHandler.GetMethodTypes(res, error, result); }, () => { error.Invoke(StatusCode.Any); }); }
internal static void GetMethodTypes(string jString, Action<int> error, MethodTypesHandler result) { var json = JObject.Parse(jString); if (BasicResultHandler.HandleError(json, error)) { return; } List<MethodType> method_types = new List<MethodType>(); foreach (var token in json["results"]) { var req = new List<string>(); foreach (var type in token[1].Values<string>()) { req.Add(type); } var res = new List<string>(); foreach (var type in token[2].Values<string>()) { res.Add(type); } method_types.Add(new MethodType() { name = token.Value<string>(0), reqtypes = req.ToArray(), restypes = res.ToArray(), version = token.Value<string>(3) }); } result.Invoke(method_types.ToArray()); }