コード例 #1
0
        private void _Paste()
        {
            var command = new MapCommand(CurrentMap, PalletViewModelManager.Clipboard);
            CurrentMap.AddHistory(command);
            PalletViewModelManager.Clipboard.Paste(CurrentMap);

            CommandCanExecuteChanged();
        }
コード例 #2
0
        private void _Cut()
        {
            var command = new MapCommand(CurrentMap, MapSelect);
            CurrentMap.AddHistory(command);
            PalletViewModelManager.Clipboard.Cut(CurrentMap);

            CommandCanExecuteChanged();
        }
コード例 #3
0
        /// <summary>
        /// ���N���b�N�ƃ}�E�X�ړ�
        /// </summary>
        /// <param name="position"></param>
        public void MouseMoveWithLeftButtonDown(MousePosition position)
        {
            var p = position.GridPoint;

            if (PalletViewModelManager.CanDraw(CurrentMap, p))
            {
                var command = new MapCommand(p, CurrentMap, MapSelect);
                _commandPool.Add(command);

                //Draw����Model��X�V
                PalletViewModelManager.Draw(CurrentMap, p, MapSelect);

                //MapControl.Rendering();
            }
        }
コード例 #4
0
        /// <summary>
        /// ���N���b�N�A�b�v
        /// </summary>
        /// <param name="position"></param>
        public void MouseLeftButtonUp(MousePosition position)
        {
            if (_commandPool.FirstOrDefault() == null) return;

            var command = new MapCommand(_commandPool);
            CurrentMap.AddHistory(command);
            _commandPool.Clear();

            CommandCanExecuteChanged();
        }
コード例 #5
0
        /// <summary>
        /// ���N���b�N�_�E��
        /// </summary>
        /// <param name="position"></param>
        public void MouseLeftButtonDown(MousePosition position)
        {
            var p = position.GridPoint;

            if (PalletViewModelManager.CanDraw(CurrentMap, p))
            {
                //�ꎞ�R�}���h�v�[���ɃR�}���h��ۑ�
                var command = new MapCommand(p, CurrentMap, MapSelect);
                _commandPool.Add(command);

                //Draw����Model��X�V
                PalletViewModelManager.Draw(CurrentMap, p, MapSelect);

                CommandCanExecuteChanged();
            }
        }
コード例 #6
0
        public void Delete()
        {
            if (!MapSelect.IsEmpty)
            {
                //Undo�R�}���h�̍쐬
                var command = new MapCommand(CurrentMap, MapSelect);
                CurrentMap.AddHistory(command);

                PalletViewModelManager.Delete(CurrentMap, MapSelect);
            }
        }