void SetDeserializedDataInUi(string PluginName, string XML, string[,] XmlNameValueArray) { if (this.BaseTabs.InvokeRequired) { SetDeserializedDataInUi_d InvokeDelegate_d = new SetDeserializedDataInUi_d(SetDeserializedDataInUi); this.BaseTabs.Invoke(InvokeDelegate_d, new object[] { PluginName, XML, XmlNameValueArray }); } else { foreach (DataGridViewRow Row in FormatPluginsGrid.Rows) { if (Row.Cells[1].Value.ToString().Equals(PluginName)) { Row.Cells[0].Value = true; } else { Row.Cells[0].Value = false; } } FormatXmlTBP.SetText(XML); ConvertXmlToObjectBtn.Text = string.Format("Convert this XML to {0}", PluginName); BodyParametersGrid.Rows.Clear(); for (int i = 0; i < XmlNameValueArray.GetLength(0); i++) { int RowId = BodyParametersGrid.Rows.Add(new object[] { XmlNameValueArray[i, 0], XmlNameValueArray[i, 1], Properties.Resources.Glass }); BodyParametersGrid.Rows[RowId].Cells[1].ReadOnly = this.ReadOnly; } ShowBodyFormatOptions(); } }
private void FormatPluginsGrid_CellClick(object sender, DataGridViewCellEventArgs e) { if (this.DisplayedRequest == null) { return; } string PluginName = ""; CurrentFormatXml = ""; CurrentXmlNameValueArray = new string[, ] { }; bool Normal = false; if (e.RowIndex == 0) { Normal = true; this.SetBodyParameters(this.DisplayedRequest, false); } foreach (DataGridViewRow Row in FormatPluginsGrid.Rows) { if (e.RowIndex == Row.Index) { PluginName = Row.Cells[1].Value.ToString(); } if (Normal && (e.RowIndex == Row.Index)) { Row.Cells[0].Value = true; } else { Row.Cells[0].Value = false; } } if (Normal) { return; } BodyParametersGrid.Rows.Clear(); FormatXmlTBP.ClearData(); ConvertXmlToObjectBtn.Text = "Convert this XML to Object"; if (FormatPluginCallingThread != null) { try { FormatPluginCallingThread.Abort(); } catch { } } if (PluginName.Length == 0) { return; } ShowStatusMsg(string.Format("Parsing Request body as {0}", PluginName)); ShowProgressBar(true); FormatPluginCallingThread = new Thread(DeserializeWithFormatPlugin); FormatPluginCallingThread.Start(PluginName); }
void ClearBodyTypeFormatPluginsUi() { BodyParametersGrid.Rows.Clear(); ConvertXmlToObjectBtn.Text = "Convert this XML to Object"; FormatXmlTBP.ClearData(); foreach (DataGridViewRow Row in FormatPluginsGrid.Rows) { Row.Cells[0].Value = false; } ResetBodyFormatXmlChangedStatus(); ResetBodyParametersChangedStatus(); }
void SetUpdatedDeserializedXmlInUi(string XML) { if (this.BaseTabs.InvokeRequired) { SetUpdatedDeserializedXmlInUi_d InvokeDelegate_d = new SetUpdatedDeserializedXmlInUi_d(SetUpdatedDeserializedXmlInUi); this.BaseTabs.Invoke(InvokeDelegate_d, new object[] { XML }); } else { FormatXmlTBP.SetText(XML); } }
private void ConvertXmlToObjectBtn_Click(object sender, EventArgs e) { if (this.ReadOnly) { return; } if (BodyFormatXmlChanged) { string XML = FormatXmlTBP.GetText(); string PluginName = this.GetSelectedFormatPluginName(); if (PluginName != "Normal" && PluginName.Length > 0 && XML.Length > 0) { this.SerializeNewXmlWithFormatPlugin(XML, PluginName); } } ResetBodyFormatXmlChangedStatus(); }
void ClearData() { if (this.BaseTabs.InvokeRequired) { ClearData_d InvokeDelegate_d = new ClearData_d(ClearData); this.BaseTabs.Invoke(InvokeDelegate_d, new object[] { }); } else { RoundTripLbl.Text = ""; HeadersTBP.ClearData(); BodyTBP.ClearData(); FormatXmlTBP.ClearData(); ConvertXmlToObjectBtn.Text = "Convert this XML to Object"; BodyFormatPluginsParametersGrid.Rows.Clear(); ReflectionRTB.Text = ""; ClearEditTab(); foreach (DataGridViewRow Row in FormatPluginsGrid.Rows) { Row.Cells[0].Value = false; } if (FormatPluginCallingThread != null) { try { FormatPluginCallingThread.Abort(); } catch { } } if (ReflectionCheckingThread != null) { try { ReflectionCheckingThread.Abort(); } catch { } } ShowStatusMsg(""); ShowProgressBar(false); } }
void ClearData() { if (this.BaseTabs.InvokeRequired) { ClearData_d InvokeDelegate_d = new ClearData_d(ClearData); this.BaseTabs.Invoke(InvokeDelegate_d, new object[] { }); } else { UseSSLCB.Checked = false; HeadersTBP.ClearData(); BodyTBP.ClearData(); FormatXmlTBP.ClearData(); ConvertXmlToObjectBtn.Text = "Convert this XML to Object"; UrlPathPartsParametersGrid.Rows.Clear(); QueryParametersGrid.Rows.Clear(); CookieParametersGrid.Rows.Clear(); HeadersParametersGrid.Rows.Clear(); BodyParametersGrid.Rows.Clear(); ClearEditTab(); foreach (DataGridViewRow Row in FormatPluginsGrid.Rows) { Row.Cells[0].Value = false; } if (FormatPluginCallingThread != null) { try { FormatPluginCallingThread.Abort(); } catch { } } ShowStatusMsg(""); ShowProgressBar(false); } }