예제 #1
0
 private void AddCustomBlock(GridBlockModel block)
 {
     if (block != null)
     {
         _customModel.Add(block);
     }
 }
예제 #2
0
 public void CompleteDesignBlock()
 {
     if (_currentBlock != null)
     {
         _currentBlock = null;
     }
 }
예제 #3
0
 private void DoUndo()
 {
     if (_customModel.Count > 0)
     {
         GridBlockModel block = _customModel[_customModel.Count - 1];
         _customModel.RemoveAt(_customModel.Count - 1);
         OnCustomBlockRemoved(new BlockCreateEventArgs(block));
     }
 }
예제 #4
0
 public void RemoveCustomBlock(GridBlockModel block)
 {
     if (block != null)
     {
         if (_customModel.Remove(block))
         {
             OnCustomBlockRemoved(new BlockCreateEventArgs(block));
         }
     }
 }
예제 #5
0
        public void UpdateDesignBlock(RowColumn curRC)
        {
            if (_currentBlock == null)
            {
                _currentBlock = new GridBlockModel(false);
                //fe.Children.Add(_currentBlock);
                AddCustomBlock(_currentBlock);
                OnCustomBlockAdded(new BlockCreateEventArgs(_currentBlock));
            }

            int rSpan = Math.Abs(curRC.Row - _starRC.Row) + 1;
            int cSpan = Math.Abs(curRC.Column - _starRC.Column) + 1;

            _currentBlock.Row        = Math.Min(curRC.Row, _starRC.Row);
            _currentBlock.Column     = Math.Min(curRC.Column, _starRC.Column);
            _currentBlock.RowSpan    = rSpan;
            _currentBlock.ColumnSpan = cSpan;
        }
예제 #6
0
 public BlockCreateEventArgs(GridBlockModel block)
 {
     _block = block;
 }