public Grid(int width, int height, T defaultValue) { Check.IsStrictlyPositive(width); Check.IsStrictlyPositive(height); CreateCells(width, height); InitializeCells(defaultValue); Rows = new GridRowCollection <T>(this); Columns = new GridColumnCollection <T>(this); }
public Grid(T[,] values) { Check.NotNull(values, nameof(values)); int width = values.GetLength(1); int height = values.GetLength(0); Check.IsStrictlyPositive(width); Check.IsStrictlyPositive(height); CreateCells(width, height); InitializeCells(values); Rows = new GridRowCollection <T>(this); Columns = new GridColumnCollection <T>(this); }