示例#1
0
        public void SetKeyCell(Cell cell)
        {
            Cell cellFind = KeyCells.FirstOrDefault(record => record.Location.Equals(cell.Location));

            if (cellFind == null)
            {
                this.KeyCells.Add(cell);
                MapBmpFillRectangle(cell, Color.DarkSlateBlue);
            }
            else
            {
                cellFind.Name = cell.Name;
            }
        }
示例#2
0
 public Cell GetKeyCell(int mouseX, int mouseY)
 {
     return(KeyCells.FirstOrDefault(record => record.Location.Equals(new Point(mouseX / this.CELL_WIDTH * CELL_WIDTH, mouseY / this.CELL_WIDTH * CELL_WIDTH))));
 }
示例#3
0
        public string GetKeyCellName(int mouseX, int mouseY)
        {
            Cell cell = KeyCells.FirstOrDefault(record => record.Location.Equals(new Point(mouseX / this.CELL_WIDTH * CELL_WIDTH, mouseY / this.CELL_WIDTH * CELL_WIDTH)));

            return(cell == null ? string.Empty : cell.Name);
        }