internal DataMatrix CalculateMatrix(BoxTypes type, ActionTypes actionTypes, int x, int y)
        {
            switch (type)
            {
            case BoxTypes.Grid:
                dataMatrix.HighlightedCol = null;
                dataMatrix.HighlightedRow = null;
                dataMatrix = CalculateGridClicked(dataMatrix, actionTypes, x, y);
                break;

            case BoxTypes.HeaderHorizontal:
                dataMatrix = CalculateTopHeaderClicked(dataMatrix, actionTypes, x, y);
                break;

            case BoxTypes.HeaderVertical:
                dataMatrix = CalculateLeftHeaderClicked(dataMatrix, actionTypes, x, y);
                break;
            }

            if (IsMatrixOpened(dataMatrix) && (ResultPublished != null))
            {
                if (dataMatrix == solutionMatrix)
                {
                    ResultPublished(this, new DataUpdatedEventArgs(dataMatrix, solutionMatrix, ResultEvent.ResultType.Correct));
                }
                else if (dataMatrix.IsEquivalent(solutionMatrix))
                {
                    ResultPublished(this, new DataUpdatedEventArgs(dataMatrix, solutionMatrix, ResultEvent.ResultType.Alternative));
                }
                else
                {
                    ResultPublished(this, new DataUpdatedEventArgs(dataMatrix, solutionMatrix, ResultEvent.ResultType.Incorrect));
                }
            }

            return(dataMatrix);
        }