private void UpdateTreeViewObstacles() { TreeNode obstaclesNode = GetObstaclesNode(); foreach (TreeNode node in obstaclesNode.Nodes) { TagData tagData = node.Tag as TagData; BTBLib.Obstacle obstacle = tagData.GetObstacleLink(); node.Checked = _drawData.ContainsObstacle(obstacle); } }