Exemplo n.º 1
0
        public override void Initialize()
        {
            LayerItemForm dlg = new LayerItemForm(LayerItemForm.Mode.Modify, _layer, this.database);

            dlg.StartPosition = FormStartPosition.CenterParent;
            DialogResult dlgRet = dlg.ShowDialog();

            if (dlgRet == DialogResult.OK)
            {
                _resultLayer = dlg.layer;
                if (_resultLayer.name == _layer.name &&
                    _resultLayer.color == _layer.color)
                {
                    _mgr.CancelCurrentCommand();
                }
                else
                {
                    _mgr.FinishCurrentCommand();
                }
            }
            else
            {
                _mgr.CancelCurrentCommand();
            }
        }
Exemplo n.º 2
0
        public override void Initialize()
        {
            LayerItemForm dlg    = new LayerItemForm(LayerItemForm.Mode.Add, null, this.database);
            DialogResult  dlgRet = dlg.ShowDialog();

            if (dlgRet == DialogResult.OK)
            {
                _layer = dlg.layer;
                _mgr.FinishCurrentCommand();
            }
            else
            {
                _mgr.CancelCurrentCommand();
            }
        }