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(); } }
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(); } }