public int this[int dimension]
{
get
{
switch (dimension)
{
case 0:
return i;
case 1:
return j;
}
throw new Exception("У индекса только 2 компоненты");
}
set
{
switch (dimension)
{
case 0:
i = value;
break;
case 1:
j = value;
break;
default:
throw new Exception("У индекса только 2 компоненты");
}
}
}