public bool Equals(ToolTipModel toCheck) { var sameTitle = Title.Equals(toCheck.Title); var sameMessage = Message.Equals(toCheck.Message); return(SameAnchor(toCheck) && sameTitle && sameMessage); }
public void Draw(ToolTipModel model) { if (model == null) { throw new Exception("ToolTip cannot be null"); } if (_model == null) { Show(model); } var same = _model.Equals(model); if (same) { return; } var sameAnchor = _model.SameAnchor(model); if (sameAnchor) { AlterVisible(model); } else { Swap(model); } }
private void Show(ToolTipModel model) { _model = model; var newToolTip = new ToolTip { ToolTipTitle = _model.Title }; newToolTip.Show(_model.Message, _model.Anchor); _toolTip = newToolTip; }
public bool SameAnchor(ToolTipModel toCheck) { return(Anchor.Equals(toCheck.Anchor)); }
private void AlterVisible(ToolTipModel model) { _model = model; _toolTip.Show(_model.Message, _model.Anchor); }
private void Swap(ToolTipModel model) { _toolTip.Hide(_model.Anchor); Show(model); }
public ToolTipHandler() { _toolTip = null; _model = null; }