public Grid(IEqualityComparer <TCell> cellEqualityComparer = null) { CellEqualityComparer = cellEqualityComparer ?? EqualityComparer <TCell> .Default; Blocks = new GridBlockCollection <TGridBlock>(); blockSize = GridBlock.DefaultBlockSize; }
protected void ResizeBlocks() { if (this.Blocks.Count == 0) { return; } var tempBlocks = Blocks; Blocks = new GridBlockCollection <TGridBlock>(); for (int i = 0; i < tempBlocks.Count; i++) { OnBlockRemoved(tempBlocks[i]); foreach (var cell in (IEnumerable <CellLocationPair <TCell> >)tempBlocks[i]) { this[cell.X, cell.Y] = cell.Content; } } }