Пример #1
0
        private void toolStripButtonRemove_Click(object sender, EventArgs e)
        {
            IProjectList list = Application.Selection as IProjectList;

            if (list == null)
            {
                return;
            }
            if (dataGridView.SelectedCells?[0] == null)
            {
                return;
            }
            int index = dataGridView.SelectedCells[0].RowIndex;

            list.RemoveAt(index);
            Application_SelectionChanged(this, new Application.SelectionChangedEventArgs(null, Application.Selection));
        }
Пример #2
0
        private void toolStripButtonLower_Click(object sender, EventArgs e)
        {
            IProjectList list = Application.Selection as IProjectList;

            if (list == null)
            {
                return;
            }
            if (dataGridView.SelectedCells?[0] == null)
            {
                return;
            }
            int index = dataGridView.SelectedCells[0].RowIndex;

            if (index < 0 || index >= list.Count - 1)
            {
                return;
            }
            object obj = list[index];

            list.RemoveAt(index);
            list.Insert(index + 1, obj);
            Application_SelectionChanged(this, new Application.SelectionChangedEventArgs(null, Application.Selection));
        }