Exemple #1
0
        private void SetResult(RoseResult result)
        {
            if (result.ResultCode == RoseResult.Ok)
            {
                if (_cbShowOnlyResult.Checked)
                {
                    _tbResponse.Text = result.Response.GetProperty("result", false)?.Value.ToString(Newtonsoft.Json.Formatting.Indented) ?? "";
                }
                else
                {
                    _tbResponse.Text = result.Response.ToString(Newtonsoft.Json.Formatting.Indented);
                }
                FormMain.SetStatus("Processing time: {0:0.##}sec     {1}",
                                   result.Response.GetProperty("processingTime").Value,
                                   result.Message);
            }
            else
            {
                _tbResponse.Text = result.Message;
                var exception = result.Response.GetProperty("exception", false);
                if (exception != null)
                {
                    _tbResponse.Text += "\r\n";
                }

                FormMain.SetStatusRed(result.Message);
            }
        }
        private void SetResult(RoseResult result)
        {
            if (result.ResultCode == RoseResult.Ok)
            {
                _tbSelect_Result.Text = result.Response.GetProperty("result", false)?.Value.ToString() ?? "";
                FormMain.SetStatus("Processing time: {0:0.###} sec     {1}",
                                   result.Response.GetProperty("processingTime").Value,
                                   result.Message);
            }
            else
            {
                _tbSelect_Result.Text = result.Message;
                var exception = result.Response.GetProperty("exception", false);
                if (exception != null)
                {
                    _tbSelect_Result.Text += "\r\n";
                }

                FormMain.SetStatusRed(result.Message);
            }
        }