9. •
•
public static IEnumerable<T> ToSequence<T>(this T[,] @this)
{ return @this.AllPoints().Select(point => @this.Get(point)); }
public static IEnumerable<Point<int>> AllPoints<T>(this T[,] @this)
{
return from x in Enumerable.Range(0, @this.GetLength(0))
from y in Enumerable.Range(0, @this.GetLength(1))
select new Point<int> { X = x, Y = y };
}