public static RemoteOpenLogic GetInstance() { if (instance == null) { instance = new RemoteOpenLogic(); } return(instance); }
public int Load(BackgroundWorker bw) { #region 获取初始化基本信息 bw.ReportProgress(stepNum += 1, "starting......"); this.databaseService = ServicesFactory.GetInstance().GetDatabaseService(); this.aboutConfig = AboutConfig.GetInstance(); this.elocksManager = ELocksManager.GetInstance(); this.boxManager = BoxsManager.GetInstance(); this.packageManager = PackageManager.GetInstance(); this.adManager = ADManager.GetInstance(); this.remoteOpenLogic = RemoteOpenLogic.GetInstance(); this.SystemTimer = new Timer(new TimerCallback(this.SystemTimer_Elapsed), null, Timeout.Infinite, Timeout.Infinite); #endregion System.Threading.Thread.Sleep(delay); bw.ReportProgress(stepNum += 1, "aboutConfig loading......"); this.aboutConfig.Load(); System.Threading.Thread.Sleep(delay); bw.ReportProgress(stepNum += 1, "boxManager loading......"); this.boxManager.Load(); System.Threading.Thread.Sleep(delay); bw.ReportProgress(stepNum += 1, "elocksManager loading......"); this.elocksManager.Load(); System.Threading.Thread.Sleep(delay); bw.ReportProgress(stepNum += 1, "packageManager loading......"); this.packageManager.Load(); System.Threading.Thread.Sleep(delay); bw.ReportProgress(stepNum += 1, "remoteOpenLogic loading......"); this.remoteOpenLogic.Load(); System.Threading.Thread.Sleep(delay); bw.ReportProgress(stepNum += 1, "adManager loading......"); this.adManager.Load(); System.Threading.Thread.Sleep(delay); bw.ReportProgress(stepNum += 1, "packageEvent loading......"); this.packageManager.PackageCreatedEvent += new PackageManager.PackageCreatedDelegate(packageManager_PackageCreatedEvent); this.packageManager.PackageTakedEvent += new PackageManager.PackageTakedDelegate(packageManager_PackageTakedEvent); this.SystemTimer.Change(0, 600 * 1000); System.Threading.Thread.Sleep(delay); bw.ReportProgress(stepNum += 1, "over"); return(stepNum); }