Skip to content
This repository has been archived by the owner on Jan 6, 2025. It is now read-only.

Commit

Permalink
Fix Spider call MainForm field issue.
Browse files Browse the repository at this point in the history
  • Loading branch information
qwqcode committed Jul 28, 2019
1 parent f14bd95 commit bd1778b
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 9 deletions.
4 changes: 2 additions & 2 deletions Nacollector/Browser/JsActions/TaskControllerAction.cs
Original file line number Diff line number Diff line change
Expand Up @@ -41,13 +41,13 @@ public void CreateTask(string taskId, string className, string classLabel, strin
ParmsJsonStr = parmsJsonStr
};

MainForm.taskRunner.NewTaskThread(settings);
_form.taskRunner.NewTaskThread(settings);
}

// 终止任务
public bool AbortTask(string taskId)
{
MainForm.taskRunner.AbortTask(taskId);
_form.taskRunner.AbortTask(taskId);

return true;
}
Expand Down
2 changes: 1 addition & 1 deletion Nacollector/Browser/JsActions/UpdateAction.cs
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ public void StartUpdateWork(string updateModulesJsonStr)

// 刷新 SpiderList
if (moduleName == "NacollectorSpiders")
MainForm.taskRunner.RefreshFrontendSpiderList();
_form.taskRunner.RefreshFrontendSpiderList();
}
else
{
Expand Down
10 changes: 5 additions & 5 deletions Nacollector/MainForm.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@ namespace Nacollector
{
public partial class MainForm : FormBase
{
public static MainForm _mainForm;
public static SplashScreen _splashScreen;
public static CrBrowser crBrowser;
public static CookieGetterBrowser cookieGetterBrowser;
public static TaskRunner taskRunner;
public MainForm _mainForm;
public SplashScreen _splashScreen;
public CrBrowser crBrowser;
public CookieGetterBrowser cookieGetterBrowser;
public TaskRunner taskRunner;

public MainForm()
{
Expand Down
2 changes: 1 addition & 1 deletion Nacollector/TaskManager/TaskRunner.cs
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ public void RefreshFrontendSpiderList()
_form.BeginInvoke((MethodInvoker)delegate
{
var spiderDomain = GetLoadSpiderDomain();
MainForm.crBrowser.RunJS(spiderDomain.GetFormGenJsCode());
_form.crBrowser.RunJS(spiderDomain.GetFormGenJsCode());
UnloadSpiderDomain();
});
}
Expand Down

0 comments on commit bd1778b

Please sign in to comment.