Esempio n. 1
0
        private void MonthDGV_DoubleClick(object sender, EventArgs e)
        {
            // the time of day was double clicked or there is nothing in the cell
            if (MonthDGV.SelectedCells[0].ColumnIndex == 0 || MonthDGV.SelectedCells[0].Value == null)
            {
                return;
            }

            // get the subject string
            string subject = MonthDGV.SelectedCells[0].Value.ToString();

            subject = subject.Substring(subject.IndexOf(' ') + 1);

            // search for the currentuser's event with that subject
            var match = CurrentUser.Events.Where(ev => ev.Subject == subject).FirstOrDefault();

            // there was no match found
            if (match == null)
            {
                return;
            }

            ViewerForm v = new ViewerForm(this, match);

            v.Show();
        }
Esempio n. 2
0
        private void EventDGV_DoubleClick(object sender, EventArgs e)
        {
            // get the subject string
            string subject = EventDGV.SelectedRows[0].Cells[1].Value.ToString();

            // search for the currentuser's event with that subject
            var match = CurrentUser.Events.Where(ev => ev.Subject == subject).FirstOrDefault();

            // there was no match found
            if (match == null)
            {
                return;
            }

            ViewerForm v = new ViewerForm(this, match);

            v.Show();
        }