Esempio n. 1
0
        public void OnLoad()
        {
            //初始化文件夹
            DataTool.initFolder();
            //初始化配置数据
            mainData = DataTool.initConfigData();
            //新建UI对象
            container = new Container();

            //创建委托对象
            TabControlEventHandler tabSelectedEvent = null;

            tabSelectedEvent = delegate(object obj, TabControlEventArgs e)
            {
                if (e.TabPage == page)
                {
                    //初始化UI
                    Init();
                    //移除委托监听
                    FiddlerApplication.UI.tabsViews.Selected -= tabSelectedEvent;
                    FiddlerApplication.Log.LogString("FiddlerExample初始化完成!");
                }
            };

            //添加委托监听
            FiddlerApplication.UI.tabsViews.Selected += tabSelectedEvent;

            //监听请求响应之前
            FiddlerApplication.BeforeRequest += delegate(Session session)
            {
                FiddlerTool.handleRequest(session);
            };
        }
Esempio n. 2
0
        public void OnLoad()
        {
            //初始化文件夹
            DataTool.initFolder();
            //初始化配置数据
            mainData = DataTool.initConfigData();
            //新建UI对象
            container = new Container();

            //新建一个Fiddler插件的page
            TabPage page = new TabPage("PlugExample");

            //将page加入Fiddler的tab选项卡中
            FiddlerApplication.UI.tabsViews.TabPages.Add(page);

            //将WinForm和WPF联系起来(在WinForm中调用WPF)
            ElementHost element = new ElementHost();

            element.Child = container;
            element.Dock  = DockStyle.Fill;

            //将WPF挂载对象添加到page中
            page.Controls.Add(element);

            //监听请求响应之前
            FiddlerApplication.BeforeRequest += delegate(Session session)
            {
                FiddlerTool.handleRequest(session);
            };
        }
Esempio n. 3
0
        public void OnLoad()
        {
            //初始化数据
            mainData = new MainModel();
            //初始化UI
            container = new Container();

            //创建委托对象
            TabControlEventHandler tabSelectedEvent = null;

            tabSelectedEvent = delegate(object obj, TabControlEventArgs e)
            {
                if (e.TabPage == page)
                {
                    //初始化UI
                    Init();
                    //主动发起一个请求,用来查询最新的版本号
                    FiddlerApplication.oProxy.SendRequest(StaticResourcesTool.versionRequestStr, null);
                    //移除委托监听
                    FiddlerApplication.UI.tabsViews.Selected -= tabSelectedEvent;
                    FiddlerApplication.Log.LogString("FPlug初始化完成!");
                }
            };

            //添加委托监听
            FiddlerApplication.UI.tabsViews.Selected += tabSelectedEvent;

            //监听请求响应之前
            FiddlerApplication.BeforeRequest += delegate(Session session)
            {
                FiddlerTool.handleRequest(session);
            };

            //监听请求响应之后
            FiddlerApplication.BeforeResponse += delegate(Session session)
            {
                FiddlerTool.handleResponse(session);
            };

            //监听websocket的请求
            FiddlerApplication.OnWebSocketMessage += delegate(object session, WebSocketMessageEventArgs msg)
            {
                FiddlerTool.handleWebSocket(session, msg);
            };
        }