-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
luoweihua7sync
committed
Jul 7, 2014
1 parent
3a7e337
commit 593ace3
Showing
21 changed files
with
930 additions
and
601 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,26 @@ | ||
What's this | ||
=========== | ||
This is a fiddler plugin. replace response like autoresponser but create rule quicker. | ||
|
||
This is a fiddler plugin. | ||
|
||
How it work? | ||
============ | ||
|
||
How to use | ||
========== | ||
####Copy f0rger.dll to anyone folder below | ||
* C:\Users\\[User]\Documents\Fiddler2\Scripts | ||
* C:\Program Files (x86)\Fiddler2\Scripts | ||
* C:\Program Files\Fiddler2\Scripts | ||
|
||
Create rules | ||
============ | ||
* copy file(s)/directory and patse on f0rger tabpage | ||
* drag file(s)/directory and patse into f0rger tabpage | ||
* click Add button | ||
|
||
Create profile | ||
============== | ||
1, enable profiles first | ||
2, click manage button below enable checkbox | ||
3, add/delete/update profile(s) | ||
|
||
TODO | ||
==== | ||
* Simulate Speed (Global) |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,168 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Text; | ||
|
||
using System.Windows.Forms; | ||
using System.Collections; | ||
using System.IO; | ||
|
||
namespace f0rger | ||
{ | ||
public class ListViewController | ||
{ | ||
public static ListView listView = new ListView(); | ||
|
||
private static Hashtable htItems = new Hashtable(); | ||
|
||
#region ListView Create/Remove/Update | ||
/// <summary> | ||
/// Add file to ListView | ||
/// </summary> | ||
/// <param name="file">file/directory path</param> | ||
public static void Add(string file) | ||
{ | ||
List<string> list = new List<string>() { file }; | ||
Add(list); | ||
} | ||
|
||
/// <summary> | ||
/// Add file to ListView | ||
/// <para>for file add</para> | ||
/// </summary> | ||
/// <param name="list">file list</param> | ||
public static void Add(List<string> list) | ||
{ | ||
listView.SuspendLayout(); | ||
foreach (string file in list) | ||
{ | ||
if (htItems.ContainsKey(file)) | ||
{ | ||
//enable when contain | ||
ListViewItem lvi = (ListViewItem)htItems[file]; | ||
lvi.Checked = true; | ||
|
||
FileMockService.Update(file, true, false); | ||
} | ||
else | ||
{ | ||
//add to list | ||
var fileName = Configs.FolderName; | ||
if (File.Exists(file)) | ||
{ | ||
fileName = Path.GetFileName(file); | ||
} | ||
ListViewItem lvi = new ListViewItem() | ||
{ | ||
Text = fileName, | ||
Checked = true | ||
}; | ||
lvi.SubItems.Add(file); | ||
|
||
listView.Items.Add(lvi); | ||
htItems.Add(file, lvi); | ||
|
||
FileMockService.Add(file, true, false); | ||
} | ||
} | ||
listView.ResumeLayout(); | ||
|
||
FileMockService.Refresh(); | ||
} | ||
|
||
/// <summary> | ||
/// Add file to ListView | ||
/// <para>for initialize</para> | ||
/// </summary> | ||
/// <param name="list">mock file list</param> | ||
public static void Add(FileMockEntityList list) | ||
{ | ||
listView.SuspendLayout(); | ||
foreach (FileMockEntity entity in list) | ||
{ | ||
string file = entity.Path; | ||
if (htItems.ContainsKey(file)) | ||
{ | ||
//enable when contain | ||
ListViewItem lvi = (ListViewItem)htItems[file]; | ||
lvi.Checked = entity.Enable; | ||
|
||
FileMockService.Update(file, true, false); | ||
} | ||
else | ||
{ | ||
//add to list | ||
var fileName = Configs.FolderName; | ||
if (File.Exists(file)) | ||
{ | ||
fileName = Path.GetFileName(file); | ||
} | ||
ListViewItem lvi = new ListViewItem() | ||
{ | ||
Text = fileName, | ||
Checked = entity.Enable | ||
}; | ||
lvi.SubItems.Add(file); | ||
|
||
listView.Items.Add(lvi); | ||
htItems.Add(file, lvi); | ||
|
||
FileMockService.Add(file, true, false); | ||
} | ||
} | ||
listView.ResumeLayout(); | ||
|
||
FileMockService.Refresh(); | ||
} | ||
|
||
/// <summary> | ||
/// Update checked list | ||
/// </summary> | ||
/// <param name="file">checked file/directory path</param> | ||
/// <param name="enable">enable</param> | ||
public static void Update(string file, bool enable) | ||
{ | ||
if (htItems.ContainsKey(file)) | ||
{ | ||
FileMockService.Update(file, enable); //update list | ||
} | ||
} | ||
|
||
/// <summary> | ||
/// Remove selected items | ||
/// </summary> | ||
public static void Remove() | ||
{ | ||
foreach (ListViewItem lvi in listView.SelectedItems) | ||
{ | ||
string file = lvi.SubItems[1].Text; | ||
FileMockService.Remove(file, false); | ||
htItems.Remove(file); | ||
listView.Items.Remove(lvi); | ||
} | ||
FileMockService.Refresh(); | ||
|
||
} | ||
|
||
/// <summary> | ||
/// Clean Up | ||
/// </summary> | ||
public static void Clear() | ||
{ | ||
foreach (ListViewItem lvi in listView.Items) | ||
{ | ||
string file = lvi.SubItems[1].Text; | ||
FileMockService.Remove(file, false); | ||
htItems.Remove(file); | ||
listView.Items.Remove(lvi); | ||
} | ||
FileMockService.Refresh(); | ||
} | ||
|
||
public static void Refresh() | ||
{ | ||
FileMockService.Refresh(); | ||
} | ||
|
||
#endregion | ||
} | ||
} |
Oops, something went wrong.