public GUIToolEditLightController(LightController controller) { Controller = controller; Setup(); Load += ReadData; FormClosing += SaveData; }
private void StopConnection() { _firstNode = null; _firstController = null; _firstMoveObject = null; _firstNodeConnection = true; _firstControllerConnection = true; _firstMove = true; Viewport.HoverConnection = new Point(-1, -1); }
private void LinkLight() { object obj = Viewport.GetObjByGridPos(); if (obj != null) { if (_firstControllerConnection && obj is LightController) { _firstController = (LightController)obj; _firstControllerConnection = false; Viewport.HoverConnection = _firstController.Position; } else if (!_firstControllerConnection && obj is Node) { _firstController.Lights.Add(obj as Node); _firstControllerConnection = true; Viewport.HoverConnection = new Point(-1, -1); } Viewport.Connections.Refresh(); } }