Is it possible to have two or more indexer (or something simillar) with the same signature?
So it would look something like this
private int[,] X;
public int this[int a]
{
set
{
X[a, 0] = value;
}
}
public int this[int a]
{
set
{
X[a, 1] = value;
}
}
This gives an error because both methods are nameless and with the same signature. So is it possible to name these methods but keep the abillity to set a value. i.e.
C.FirstCol(2) = 3; //Same as C.X[2,0] = 3
C.SecondCol(5) = 4; //Same as C.X[5,1] = 4
EDIT: I'll try to explain it better:
The line C.SetX(value)
can be changed to C.X = value
by using properties.
The line C.Set(num, value)
can be changed to C[num] = value
by using indexer
What I am asking is how can I change these lines
C.SetA(num, value)
C.SetB(num, value)
To
C.A[num] = value
C.B[num] = value
Or
C.A(num) = value
C.B(num) = value
Without having A or B as arrays