Example #1
0
        public void UpdateTaskTriggerDataGrid()
        {
            if (this.dataGridTaskTrigger.InvokeRequired)
            {
                SetTaskTriggerDataGridCallback d = new SetTaskTriggerDataGridCallback(SetTaskTriggerDataGrid);
                this.Invoke(d, new object[] { });
            }
            else
            {
                List<SerialTrigger> TaskTriggerList;

                if (dataGridTask.SelectedRows == null)
                {
                    TaskTriggerList = FindTask(dataGridTask.Rows[0].Cells[0].Value.ToString()).GetSerialTriggers();
                }
                else
                {
                    TaskTriggerList = FindTask(dataGridTask.SelectedRows[0].Cells[0].Value.ToString()).GetSerialTriggers();
                }

                TaskTriggerDataTable.Rows.Clear();
                foreach (SerialTrigger t in TaskTriggerList)
                {
                    if (t != null)
                    {
                        TaskTriggerDataTable.Rows.Add(t.GetName(), t.GetDetails(), t.GetStatus());
                    }
                }

                dataGridTaskTrigger.DataSource = TaskTriggerDataTable;
                dataGridTaskTrigger.Refresh();
                toolStriplblLastUpdate.Text = "Last Updated At: " + DateTime.Now.ToString("HH:mm:ss");
            }
        }
Example #2
0
        private void SetTaskTriggerDataGrid(List<SerialTrigger> TaskTriggerList)
        {
            if (this.dataGridTaskTrigger.InvokeRequired)
            {
                SetTaskTriggerDataGridCallback d = new SetTaskTriggerDataGridCallback(SetTaskTriggerDataGrid);
                this.Invoke(d, new object[] { TaskTriggerList });
            }
            else
            {
                TaskTriggerDataTable.Rows.Clear();

                foreach (SerialTrigger t in TaskTriggerList)
                {
                    if (t != null)
                    {
                        TaskTriggerDataTable.Rows.Add(t.GetName(), t.GetDetails(), t.GetStatus());
                    }
                }

                dataGridTaskTrigger.DataSource = TaskTriggerDataTable;
                dataGridTaskTrigger.Refresh();
                toolStriplblLastUpdate.Text = "Last Updated At: " + DateTime.Now.ToString("HH:mm:ss");
            }
        }