public frmMain(bool isAutoRun = false) { _isAutoRun = isAutoRun; InitializeComponent(); System.Windows.Forms.Control.CheckForIllegalCrossThreadCalls = false; OnIPRetriveProgress += new IPRetriveProgress(UpdateUIProgress); OnLogQueryStatus += new LogQueryStatus(frmMain_OnLogQueryStatus); OnIPScanProgress += new IPScanProgress(UpdateUIProgressForIPScan); try { top_lblCurrentIPRetrive_Click(null, null); SettingBiz biz = new SettingBiz(); myTimer.Tick += new EventHandler(TimerEventProcessor); myTimer.Interval = biz.GetSettings().ExecuteInterval * (1000 * 60 * 60); myTimer.Start(); if (isAutoRun) { SettingBiz settingBiz = new SettingBiz(); var settingData = settingBiz.GetSettings(); SendRequestToRetrieveIP(settingData.StartupRunTimes); } } catch { } }
private void frmScan_Load(object sender, EventArgs e) { OnIPScanProgress += new IPScanProgress(UpdateUIProgress); }