private void _UnsetRelation(IRelationSetter relationSetter) { if (relationSetter.UnsetRelation()) { this.UpdateCanvas(); } }
private void _SetRelation(IRelationSetter relationSetter) { if (relationSetter is EmptyRelationSetter) { return; } RelationDialog relationDialog = new RelationDialog(); relationDialog.ShowDialog(); if (relationSetter.SetRelation(relationDialog.Relation)) { this.UpdateCanvas(); } relationDialog.Dispose(); }
public override void MouseClick(object obj, MouseEventArgs e) { IRelationSetter relationSetter = _GetRelationSetter(e.Location); switch (e.Button) { case MouseButtons.Left: try { _SetRelation(relationSetter); } catch (OperationImpossibleException exception) { MessageBox.Show(exception.Message); } break; case MouseButtons.Right: _UnsetRelation(relationSetter); break; } }