Esempio n. 1
0
        private void dataGv_SelectionChanged(object sender, EventArgs e)
        {
            if (selCombo.SelectedIndex == -1)
            {
                return;
            }
            var selectedCellCount = dataGv.GetCellCount(DataGridViewElementStates.Selected);

            if (selectedCellCount <= 0)
            {
                return;
            }

            int index = selCombo.SelectedIndex;
            int type = 0, count = 0;

            GetTypeAndCount(index, ref type, ref count);

            List <Point> pl = new List <Point>();

            for (int i = 0; i < selectedCellCount; ++i)
            {   //pl 所有被選取的點集合
                pl.Add(new Point(dataGv.SelectedCells[i].RowIndex, dataGv.SelectedCells[i].ColumnIndex));
            }
            addBtn.Enabled = SideFlowtUtility.IsAllInEmpty(p, pl, type, count);

            List <Point> pts = (type == 0) ? sideOutObjects[count].sideFlowPoints : sideInObjects[count].sideFlowPoints;

            removeBtn.Enabled = CheclRemoveBtnEnabled(pts, pl);

            editBtn.Enabled = CheclEditBtnEnabled(type, count);
        }