public frmTransError(HttpRestClient httpRestClient) : this()
        {
            this.httpRestClient = httpRestClient;

            txtRespCode.Text = ("" + httpRestClient.ResponseCode);
            txtRespMesg.Text = httpRestClient.ResponseMessage;

            dynamic jsonObj = httpRestClient.getJsonObject();

            if (jsonObj == null)
            {
                txtErrorInfoMessage.Text = httpRestClient.getString();
            }
            else
            {
                try
                {
                    txtServerName.Text    = jsonObj["_metadata"]["ServerName"];
                    txtClientAddr.Text    = jsonObj["_metadata"]["ClientAddr"];
                    txtRequestMethod.Text = jsonObj["_metadata"]["RequestMethod"];
                    txtRequestPath.Text   = jsonObj["_metadata"]["RequestPath"];
                    txtRequestId.Text     = jsonObj["_metadata"]["RequestId"];
                }
                catch (RuntimeBinderException)
                {
                    Console.WriteLine("_metadata not found.");
                }

                try
                {
                    txtErrorInfoType.Text    = jsonObj["_errorInfo"]["Type"];
                    txtErrorInfoMessage.Text = jsonObj["_errorInfo"]["Message"];
                }
                catch (RuntimeBinderException)
                {
                    Console.WriteLine("_errorInfo not found.");
                }
            }
        }
Esempio n. 2
0
 public frmTransWaiting(HttpRestClient httpRestClient) : this()
 {
     this.httpRestClient = httpRestClient;
 }