/// <summary> /// Constructor /// </summary> public EngineService() { _jobService = ObjectFactory.GetInstance<iJobService>(); _running = false; _loaded = false; }
/// <summary> /// Constructor /// </summary> public JobsViewStack(iActiveJobService pActiveJobService, iJobService pJobService) { InitializeComponent(); // add a tab for the main thread Add(new PanelJob(Guid.Empty)); pJobService.JobCreated += onJobCreated; pActiveJobService.JobChanged += Activate; }
/// <summary> /// Constructor /// </summary> protected JobAction([NotNull] string pName, bool pSupportTasks = false) { if (pName == null) { throw new ArgumentNullException("pName"); } _name = pName; _supportTasks = pSupportTasks; ActiveJobService = ObjectFactory.GetInstance<iActiveJobService>(); JobService = ObjectFactory.GetInstance<iJobService>(); }
/// <summary> /// Assigns a job to the panel. /// </summary> public void setJobID(Guid pJobID) { JobID = pJobID; ActionService = ObjectFactory.GetInstance<iActionService>(); JobService = ObjectFactory.GetInstance<iJobService>(); ActiveJobService = ObjectFactory.GetInstance<iActiveJobService>(); foreach (JobControl jobControl in Controls.OfType<JobControl>()) { jobControl.setJobID(pJobID); } Configured = true; onJobAssigned(); }
/// <summary> /// Configures the logger. /// </summary> private void ConfigureLogger(iJobService pJobService) { DetailFormat detail = new DetailFormat(); DetailFormat.Register("main"); CreateThreadLogger("main", Thread.CurrentThread.ManagedThreadId); CreateErrorLogger(); _logger.Fine(new String('*', 80)); _logger.Fine("{0} Started", _theme.Title); _logger.Fine(new String('*', 80)); // output each job to it's own log file. pJobService.JobStart += pGuid=> { iJobReport jobReport = pJobService.getJobReport(pGuid, false); CreateThreadLogger(string.Format("{0}.{1}", jobReport.Plugin, jobReport.Code), jobReport.ThreadID); }; }
/// <summary> /// Constructor /// </summary> public EmailTask(iJobService pJobService, iEmailService pEmailService, iMailingListService pMailingList) { if (pJobService == null || pEmailService == null || pMailingList == null) { throw new NullReferenceException(); } _jobService = pJobService; _emailService = pEmailService; _mailingList = pMailingList; Resources resources = new Resources(GetType(), "Email.Templates"); string markdown = resources.ReadAsString("email.md"); using (StringReader reader = new StringReader(markdown)) { _template = new Template(); _template.Load(reader); } _markdown = new Markdown { ExtraMode = true, SafeMode = false }; }
/// <summary> /// Constructor /// </summary> public JobsView(iEngineService pEngineService, iJobService pJobService) { _engineService = pEngineService; _jobService = pJobService; InitializeComponent(); view.DataSource = _dataTable = CreateDataTable(); _boldFont = new Font(Font, FontStyle.Bold); // create a row for the Main tab DataRow main = _dataTable.NewRow(); main[0] = Guid.Empty; main[1] = "Core"; main[2] = "Main"; _dataTable.Rows.Add(main); DataGridViewColumn column = view.Columns[_COLUMN_ID]; if (column != null) { column.Visible = false; } _engineService.onStart += onEngineStart; }
/// <summary> /// Constructor /// </summary> public Main([NotNull] iActionService pActionService, [NotNull] iAppTheme pAppTheme, [NotNull] iEngineService pEngineService, [NotNull] iJobService pJobService, [NotNull] iPluginStorage pStorage, [NotNull] iActiveJobService pActiveJobService, [NotNull] iJobsView pJobsView) { if (pActionService == null) { throw new ArgumentNullException("pActionService"); } if (pAppTheme == null) { throw new ArgumentNullException("pAppTheme"); } if (pEngineService == null) { throw new ArgumentNullException("pEngineService"); } if (pJobService == null) { throw new ArgumentNullException("pJobService"); } if (pStorage == null) { throw new ArgumentNullException("pStorage"); } if (pActiveJobService == null) { throw new ArgumentNullException("pActiveJobService"); } if (pJobsView == null) { throw new ArgumentNullException("pJobsView"); } InitializeComponent(); _theme = pAppTheme; _engineService = pEngineService; _jobService = pJobService; _storage = pStorage; _activeJobService = pActiveJobService; _actionService = pActionService; pJobsView.setJobMenu(menuJob); pJobsView.setTaskMenu(menuTask); Control reportCtrl = pJobsView.getControl(); reportCtrl.Dock = DockStyle.Fill; splitter.Panel1.Controls.Add(reportCtrl); _jobsViewStack = new JobsViewStack(pActiveJobService, _jobService) { Dock = DockStyle.Fill, TabIndex = 2 }; splitter.Panel2.Controls.Add(_jobsViewStack); pActiveJobService.JobChanged += onSelectedJobChanged; trayIcon.Text = _theme.Title; trayIcon.Icon = _theme.Icon; Text = _theme.Title; Icon = _theme.Icon; }