public IMatrixElement GetElementBelow(IMatrixLine line, IMatrixElement element) { if (!HasLineBelow(MatrixInstance.IndexOf(line))) { return(GetEmptyElement()); } int indexOfElement = line.Line.IndexOf(element); IMatrixLine lineBelow = MatrixInstance[MatrixInstance.IndexOf(line) + 1]; return(lineBelow.GetElementAtIndex(indexOfElement)); }
public IMatrixElement GetElementAbove(IMatrixLine line, IMatrixElement element) { if (!HasLineAbove(MatrixInstance.IndexOf(line))) { return(GetEmptyElement()); } int indexOfElement = line.Line.IndexOf(element); IMatrixLine lineAbove = MatrixInstance[MatrixInstance.IndexOf(line) - 1]; return(lineAbove.GetElementAtIndex(indexOfElement)); }