Это не должно быть слишком сложно, чтобы написать самостоятельно.
Особое внимание следует уделить тому, как массивы можно редактировать как свойства.
Что-то вроде (очень грубый непроверенный код, но должен дать вам представление):
public class ArrayRow<T> {
//add your own ..ctor etc
T[,] matrix; //don't make this public see http://msdn.microsoft.com/en-us/library/k2604h5s.aspx
public int Index { get; private set; }
//note that this will be a copy
public T[] GetValues() {
T[] retval = new T[matrix.GetLength(1)];
for ( int i = 0; i < retval.Length; i++ )
retval[i] = matrix[Index, i];
return retval;
}
public void SetValues(T[] values)
//..and so on, you get the idea
}
Затем вы расширяете массив:
public static ArrayExtensions {
public void SetRow<T> ( this T[,] matrix, int rowIndex, T[] values ) {
//check rowIndex in range and array lengths match
}
public ArrayRow<T> GetRow<T> ( this T[,] matrix, int rowIndex ) {
//check rowIndex in range
return new ArrayRow<T> ( matrix, rowIndex );
}
}
Тогда вы можете рассчитывать на вывод параметра типа.