2 using System.Collections.Generic;
3 using System.ComponentModel;
7 using System.Windows.Forms;
9 namespace Sample_Environment_Control_Interface.Dialogs.Messages
15 public delegate
void QuestionHandler();
21 InitializeComponent();
27 foreach (DataGridViewColumn i
in dataGridView1.Columns)
29 i.SortMode = DataGridViewColumnSortMode.NotSortable;
33 public void addMessages(Seci.SerialisableList<Seci.LabView.MessageInfo> messages)
36 dataGridView1.Rows.Clear();
38 for (
int i = 0; i < messages.Count; ++i)
51 if (messages[i].WaitForResponse)
54 img = Sample_Environment_Control_Interface.Properties.Resources.LabView_Question.ToBitmap();
60 img = Sample_Environment_Control_Interface.Properties.Resources.LabView_Error.ToBitmap();
64 dataGridView1.Rows.Insert(0, img, question, messages[i].TimeAdded.ToShortDateString(), messages[i].TimeAdded.ToShortTimeString(), messages[i].VIName, messages[i].Message, messages[i].YesText, messages[i].NoText);
70 if (dataGridView1.CurrentRow != null)
76 if (dataGridView1.CurrentRow.Cells[1].Value.ToString() ==
"True")
78 int rownum = dataGridView1.CurrentRow.Index;
81 String question =
"Source: " + dataGridView1.Rows[rownum].Cells[4].Value.ToString() + Environment.NewLine + Environment.NewLine + dataGridView1.Rows[rownum].Cells[5].Value.ToString();
82 Generic_PopUp popup =
new Generic_PopUp(
"Question", question, dataGridView1.Rows[rownum].Cells[6].Value.ToString(), dataGridView1.Rows[rownum].Cells[7].Value.ToString());
83 if (popup.ShowDialog() == DialogResult.Yes)
86 Seci.SeciInterface.LVQ_SendReply(dataGridView1.Rows[rownum].Cells[5].Value.ToString(), dataGridView1.Rows[rownum].Cells[4].Value.ToString(),
true);
91 Seci.SeciInterface.LVQ_SendReply(dataGridView1.Rows[rownum].Cells[5].Value.ToString(), dataGridView1.Rows[rownum].Cells[4].Value.ToString(),
false);
96 int rownum = dataGridView1.CurrentRow.Index;
99 String message =
"Source: " + dataGridView1.Rows[rownum].Cells[4].Value.ToString() + Environment.NewLine + Environment.NewLine + dataGridView1.Rows[rownum].Cells[5].Value.ToString();
101 if (popup.ShowDialog() == DialogResult.Yes)
104 Seci.SeciInterface.LVQ_SendReply(dataGridView1.Rows[rownum].Cells[5].Value.ToString(), dataGridView1.Rows[rownum].Cells[4].Value.ToString(),
true);
void LabView_Errors_Load(object sender, EventArgs e)
QuestionHandler QuestionAsked
void dataGridView1_CellDoubleClick(object sender, DataGridViewCellEventArgs e)
QuestionHandler QuestionAnswered
void addMessages(Seci.SerialisableList< Seci.LabView.MessageInfo > messages)