예제 #1
0
 private void topicsGrid_CellClick(object sender, DataGridViewCellEventArgs e)
 {
     if (e.ColumnIndex == 2)
     {
         dal.Topic currTopic = ((dal.Topic)topicsGrid.Rows[e.RowIndex].DataBoundItem);
         _client.Unsubscribe(new String[] { currTopic.TopicName });
         MessageBox.Show("Topic Request Sent", "Removing topic request sent to server", MessageBoxButtons.OK, MessageBoxIcon.Information);
     }
 }
예제 #2
0
        private void topicsGrid_RowsAdded(object sender, DataGridViewRowsAddedEventArgs e)
        {
            for (int i = 0; i < topicsGrid.Rows.Count; i++)
            {
                dal.Topic currTopic = ((dal.Topic)topicsGrid.Rows[i].DataBoundItem);
                switch (currTopic.QOS)
                {
                case QOS.AT_MOST_ONCE:
                    ((DataGridViewImageCell)topicsGrid.Rows[i].Cells[1]).Value = Properties.Resources.icon_qos_0;
                    break;

                case QOS.AT_LEAST_ONCE:
                    ((DataGridViewImageCell)topicsGrid.Rows[i].Cells[1]).Value = Properties.Resources.icon_qos_1;
                    break;

                case QOS.EXACTLY_ONCE:
                    ((DataGridViewImageCell)topicsGrid.Rows[i].Cells[1]).Value = Properties.Resources.icon_qos_2;
                    break;
                }
            }
        }