Yes, it helped in that part, but I identified. That the errors origin is coming from this section of code:
private void ResponseTextBox_TextChanged(object sender, EventArgs e)
{
ResponseTextBox.TextChanged -= ResponseTextBox_TextChanged;
string input = ResponseTextBox.Text;
try
{
//Try and parse Json string
JObject jObject = JObject.Parse(input);
string formattedJson = JsonConvert.SerializeObject(jObject, Formatting.Indented);
ResponseTextBox.Clear();
FormatAndColorCodeJson(formattedJson);
}
catch (JsonException)
{
string correctedJson = TryToCorrectJson(input);
try
{
JObject correctedJObject = JObject.Parse(correctedJson);
string formattedJson = JsonConvert.SerializeObject(correctedJson, Formatting.Indented);
FormatAndColorCodeJson(formattedJson);
}
catch (JsonException je)
{
// MessageBox.Show(je.Message);
}
}
//readd event handler
ResponseTextBox.TextChanged += ResponseTextBox_TextChanged;
}