2 using System.Collections.Generic;
3 using System.ComponentModel;
8 using System.Windows.Forms;
10 namespace SeciControls
29 foreach (DataGridViewColumn column
in dgv1.Columns)
31 column.SortMode = DataGridViewColumnSortMode.NotSortable;
44 for (
int i = 0; i < dgv1.RowCount; ++i)
47 if (
dgv1.Rows[i].Cells[0].Value.ToString() !=
"True")
50 Seci.Standard.MessageQueue.SendReply(dgv1.Rows[i].Cells[
"colMessage"].Value.ToString(),
dgv1.Rows[i].Cells[
"colSource"].Value.ToString(),
true);
55 public void AddMessages(Seci.SerialisableList<Seci.Standard.MessageInfo> messages)
60 for (
int i = 0; i < messages.Count; ++i)
73 if (messages[i].WaitForResponse)
86 dgv1.Rows.Insert(0, question, type, messages[i].TimeAdded.ToShortDateString(), messages[i].TimeAdded.ToShortTimeString(), messages[i].Count ,messages[i].VIName, messages[i].Message, messages[i].YesText, messages[i].NoText);
92 if (
dgv1.CurrentRow != null)
100 if (
dgv1.CurrentRow != null)
109 if (
dgv1.CurrentRow.Cells[0].Value.ToString() ==
"True")
111 int rownum = dgv1.CurrentRow.Index;
114 String question =
"Source: " + dgv1.Rows[rownum].Cells[
"colSource"].Value.ToString() + Environment.NewLine + Environment.NewLine +
dgv1.Rows[rownum].Cells[
"colMessage"].Value.ToString();
115 Generic_PopUp popup =
new Generic_PopUp(
"Question", question,
dgv1.Rows[rownum].Cells[
"colYes"].Value.ToString(), dgv1.Rows[rownum].Cells[
"colNo"].Value.ToString());
116 if (popup.ShowDialog() == DialogResult.Yes)
119 Seci.Standard.MessageQueue.SendReply(dgv1.Rows[rownum].Cells[
"colMessage"].Value.ToString(),
dgv1.Rows[rownum].Cells[
"colSource"].Value.ToString(),
true);
124 Seci.Standard.MessageQueue.SendReply(dgv1.Rows[rownum].Cells[
"colMessage"].Value.ToString(),
dgv1.Rows[rownum].Cells[
"colSource"].Value.ToString(),
false);
129 int rownum = dgv1.CurrentRow.Index;
132 String message =
"Source: " + dgv1.Rows[rownum].Cells[
"colSource"].Value.ToString() + Environment.NewLine + Environment.NewLine +
dgv1.Rows[rownum].Cells[
"colMessage"].Value.ToString();
134 if (popup.ShowDialog() == DialogResult.Yes)
137 Seci.Standard.MessageQueue.SendReply(dgv1.Rows[rownum].Cells[
"colMessage"].Value.ToString(),
dgv1.Rows[rownum].Cells[
"colSource"].Value.ToString(),
true);
void InitializeComponent()
Required method for Designer support - do not modify the contents of this method with the code editor...
void ShowSelectedMessage()
delegate void QuestionHandler()
void MessagesControl_Load(object sender, EventArgs e)
QuestionHandler OnQuestionAsked
System.Windows.Forms.DataGridView dgv1
QuestionHandler OnQuestionAnswered
void dgv1_CellDoubleClick(object sender, DataGridViewCellEventArgs e)
void AddMessages(Seci.SerialisableList< Seci.Standard.MessageInfo > messages)
void RemoveAllErrorMessages()