Exemplo n.º 1
0
        public Grid(IEqualityComparer <TCell> cellEqualityComparer = null)
        {
            CellEqualityComparer = cellEqualityComparer ?? EqualityComparer <TCell> .Default;

            Blocks    = new GridBlockCollection <TGridBlock>();
            blockSize = GridBlock.DefaultBlockSize;
        }
Exemplo n.º 2
0
        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;
                }
            }
        }