Esempio n. 1
0
        private void FreeHttpWindow_Load(object sender, EventArgs e)
        {
            try
            {
                LoadFiddlerModificHttpRuleCollection(fiddlerModificHttpRuleCollection);
            }
            catch (Exception ex)
            {
                MessageBox.Show(string.Format("{0}\r\n{1}", ex.Message, ex.InnerException == null? "":ex.InnerException.Message), "load user rule fail");
                if (File.Exists("RuleData.xml"))
                {
                    File.Copy("RuleData.xml", "RuleData.lastErrorFile", true);
                }
            }
            if (StaticDataCollection == null)
            {
                StaticDataCollection = new ActuatorStaticDataCollection(true);
            }
            if (ModificSettingInfo == null)
            {
                ModificSettingInfo = new FiddlerModificSettingInfo(false, true, true);
            }
            if (ModificSettingInfo.IsDefaultEnableRule)
            {
                pb_requestRuleSwitch_Click(null, null);
                pb_responseRuleSwitch_Click(null, null);
            }

            FreeHttp.MyHelper.MyGlobalHelper.OnGetGlobalMessage += ((obj, arg) => { PutWarn(arg.Message); });

            tbe_RequestBodyModific.Visible          = false;
            tbe_ResponseBodyModific.Visible         = false;
            tbe_urlFilter.Visible                   = false;
            tbe_RequestBodyModific.OnCloseEditBox  += tbe_BodyModific_OnCloseEditBox;
            tbe_ResponseBodyModific.OnCloseEditBox += tbe_BodyModific_OnCloseEditBox;
            tbe_urlFilter.OnCloseEditBox           += tbe_BodyModific_OnCloseEditBox;


            cb_macthMode.SelectedIndex       = 0;
            tabControl_Modific.SelectedIndex = 0;
            IsSetResponseLatencyEable        = false;

            //rtb_MesInfo.AllowDrop = true;
            //rtb_MesInfo.DragEnter += rtb_MesInfo_DragEnter;
            //rtb_MesInfo.DragDrop += rtb_MesInfo_DragDrop;

            splitContainer_httpEditInfo.AllowDrop  = true;
            splitContainer_httpEditInfo.DragEnter += rtb_MesInfo_DragEnter;
            splitContainer_httpEditInfo.DragDrop  += rtb_MesInfo_DragDrop;

            panel_modific_Contorl.AllowDrop  = true;
            panel_modific_Contorl.DragEnter += rtb_MesInfo_DragEnter;
            panel_modific_Contorl.DragDrop  += rtb_MesInfo_DragDrop;

            MyControlHelper.SetRichTextBoxDropString(rtb_requsetReplace_body);
            MyControlHelper.SetRichTextBoxDropString(rtb_requestRaw);
        }
Esempio n. 2
0
 /// <summary>
 /// FreeHttpWindow
 /// </summary>
 /// <param name="yourRuleCollection">the history rule</param>
 public FreeHttpWindow(FiddlerModificHttpRuleCollection yourRuleCollection, FiddlerModificSettingInfo yourModifcSettingInfo, ActuatorStaticDataCollection yourStaticDataCollection)
     : this()
 {
     fiddlerModificHttpRuleCollection = yourRuleCollection;
     ModificSettingInfo   = yourModifcSettingInfo;
     StaticDataCollection = yourStaticDataCollection;
     if (fiddlerModificHttpRuleCollection != null && StaticDataCollection != null)
     {
         foreach (var fr in fiddlerModificHttpRuleCollection.ResponseRuleList)
         {
             fr.ActuatorStaticDataController = new FiddlerActuatorStaticDataCollectionController(StaticDataCollection);
             if (fr.IsRawReplace)
             {
                 if (fr.HttpRawResponse.ParameterizationContent == null)
                 {
                     fr.HttpRawResponse.ParameterizationContent = new AutoTest.ParameterizationContent.CaseParameterizationContent(fr.HttpRawResponse.OriginSting);
                 }
                 fr.HttpRawResponse.SetActuatorStaticDataCollection(StaticDataCollection);
             }
         }
         foreach (var fr in fiddlerModificHttpRuleCollection.RequestRuleList)
         {
             fr.ActuatorStaticDataController = new FiddlerActuatorStaticDataCollectionController(StaticDataCollection);
             if (fr.IsRawReplace)
             {
                 if (fr.HttpRawRequest.ParameterizationContent == null)
                 {
                     fr.HttpRawRequest.ParameterizationContent = new AutoTest.ParameterizationContent.CaseParameterizationContent(fr.HttpRawRequest.OriginSting);
                 }
                 fr.HttpRawRequest.SetActuatorStaticDataCollection(StaticDataCollection);
             }
         }
     }
     if (!rawResponseEdit.SetContextMenuStrip(contextMenuStrip_AddFile))
     {
         MessageBox.Show("RawResponseEdit SetContextMenuStrip fail");
     }
 }
Esempio n. 3
0
 public SettingWindow(FiddlerModificSettingInfo yourModifcSettingInfo) : this()
 {
     modifcSettingInfo = yourModifcSettingInfo;
 }