void INMouseEventCallback.OnMouseEvent(NAspNetThinWebControl control, NBrowserMouseEventArgs e) { NThinDiagramControl diagramControl = (NThinDiagramControl)control; NNodeList nodes = diagramControl.HitTest(new NPointF(e.X, e.Y)); NNodeList shapes = nodes.Filter(CellFilter); if (shapes.Count == 0) { return; } NClickomaniaGame game = (NClickomaniaGame)diagramControl.Document.Tag; NTableCell cell = (NTableCell)shapes[0]; if (cell.ParentNode.ParentNode != game.BoardShape) { return; } if (String.IsNullOrEmpty(cell.StyleSheetName)) { return; } if (game.OnCellClicked(cell) == false) { return; } // The user has clicked on a cell that is part of a region diagramControl.ServerSettings.EnableAutoUpdate = true; diagramControl.Update(); }
void INAutoUpdateCallback.OnAutoUpdate(NAspNetThinWebControl control) { NThinDiagramControl diagramControl = (NThinDiagramControl)control; NClickomaniaGame game = (NClickomaniaGame)diagramControl.Document.Tag; game.ClearHighlightedCells(); diagramControl.ServerSettings.EnableAutoUpdate = false; diagramControl.Update(); }