Ejemplo n.º 1
0
        /// <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;
        }
Ejemplo n.º 2
0
        /// <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;
        }