示例#1
0
        void DeserializeWithFormatPlugin(object PluginNameObject)
        {
            string PluginName = PluginNameObject.ToString();

            try
            {
                Request      Req = DisplayedRequest.GetClone(true);
                FormatPlugin FP  = FormatPlugin.Get(PluginName);
                CurrentFormatXml         = FP.ToXmlFromRequest(Req);
                CurrentXmlNameValueArray = FormatPlugin.XmlToArray(CurrentFormatXml);
                ShowStatusMsg("");
                SetDeserializedDataInUi(PluginName, CurrentFormatXml, CurrentXmlNameValueArray);
                this.ResetBodyParametersChangedStatus();
                ShowProgressBar(false);
            }
            catch (ThreadAbortException)
            {
                ShowStatusMsg("");
            }
            catch (Exception Exp)
            {
                IronException.Report(string.Format("Error converting Request to {0}", PluginName), Exp);
                ShowErrorMsg(string.Format("Unable to parse Request body as {0}", PluginName));
                ShowProgressBar(false);
            }
        }
示例#2
0
 void SerializeNewXmlWithFormatPlugin(string XML, string PluginName)
 {
     this.CurrentFormatXml         = XML;
     this.CurrentXmlNameValueArray = FormatPlugin.XmlToArray(this.CurrentFormatXml);
     if (FormatPluginCallingThread != null)
     {
         try
         {
             FormatPluginCallingThread.Abort();
         }
         catch { }
     }
     ShowProgressBar(true);
     ShowStatusMsg(string.Format("Updating edited values in {0}", PluginName));
     FormatPluginCallingThread = new Thread(SerializeNewXmlWithFormatPlugin);
     FormatPluginCallingThread.Start(PluginName);
 }
示例#3
0
        void AutoDetectFormatAndSetBodyParameters(object ReqObj)
        {
            try
            {
                Request Req    = ((Request)ReqObj).GetClone();
                string  FPName = FormatPlugin.Get(Req);

                if (FPName == "Normal")
                {
                    SetBodyParameters(Req, true);
                }
                else if (FPName.Length == 0)
                {
                    SetBodyParameters(Req, false);
                }
                else
                {
                    try
                    {
                        FormatPlugin FP = FormatPlugin.Get(FPName);
                        CurrentFormatXml         = FP.ToXmlFromRequest(Req);
                        CurrentXmlNameValueArray = FormatPlugin.XmlToArray(CurrentFormatXml);
                        SetDeserializedDataInUi(FP.Name, CurrentFormatXml, CurrentXmlNameValueArray);
                    }
                    catch
                    {
                        SetBodyParameters(Req, false);
                    }
                }
                this.ResetBodyParametersChangedStatus();
            }
            catch (ThreadAbortException) { }
            finally
            {
                ShowStatusMsg("");
                ShowProgressBar(false);
            }
        }
示例#4
0
 void AutoDetectFormatAndSetBodyParameters(object ResObj)
 {
     try
     {
         Response Res    = ((Response)ResObj).GetClone();
         string   FPName = FormatPlugin.Get(Res);
         if (FPName.Length > 0 && FPName != "Normal")
         {
             try
             {
                 FormatPlugin FP = FormatPlugin.Get(FPName);
                 CurrentFormatXml         = FP.ToXmlFromResponse(Res);
                 CurrentXmlNameValueArray = FormatPlugin.XmlToArray(CurrentFormatXml);
                 SetDeserializedDataInUi(FP.Name, CurrentFormatXml, CurrentXmlNameValueArray);
             }
             catch
             { }
         }
         this.ResetBodyTypeFormatPluginsParametersChangedStatus();
         ShowStatusMsg("");
         ShowProgressBar(false);
     }
     catch {}
 }