/// <summary> /// Raises the <see cref="E:System.Windows.Forms.Control.Paint" /> event. /// </summary> /// <param name="e">A <see cref="T:System.Windows.Forms.PaintEventArgs" /> that contains the event data.</param> protected override void OnPaint(PaintEventArgs e) { base.OnPaint(e); if (AllowTransparency) { MakeTransparent(this, e.Graphics); } ZeroitBreadCrumb.dc(e, this.ForeColor, 0, Text, this.img, this.clicked, this.hovered, this.chk, this.chkbox, this.c == null ? this.Width : (this.Width - this.c.Width), this.Font, this.tai, this.txta, this.imga, this.Parent is ZeroitBreadCrumb, this.Controls.Count > 0); }
/// <summary> /// Creates a new instance of the CrumbClickEventArgs class with the necessary parameters. /// </summary> /// <param name="index">The index of the clicked crumb.</param> /// <param name="checkd">Was the crumb checked before it was clicked?</param> /// <param name="checksonclick">Is the crumb supposed to change it's checked state when clicked?</param> /// <param name="sender">The clicked crumb.</param> internal CrumbClickEventArgs(int index, bool checkd, bool checksonclick, ZeroitBreadCrumb sender) { Index = index; Sender = sender; if (ChecksOnClick = checksonclick) { CheckedAfter = !(CheckedBefore = checkd); } else { CheckedAfter = CheckedBefore = checkd; } }
/// <summary> /// cs the child. /// </summary> /// <param name="cr">The cr.</param> /// <returns><c>true</c> if XXXX, <c>false</c> otherwise.</returns> private bool cChild(ZeroitBreadCrumb cr) { try { var c = cr.Child; while (c != null) { if (c == this) { return(true); } else { c = c.Child; } } } catch { } return(false); }
/// <summary> /// cs the parent. /// </summary> /// <param name="cr">The cr.</param> /// <returns><c>true</c> if XXXX, <c>false</c> otherwise.</returns> private bool cParent(ZeroitBreadCrumb cr) { try { var c = cr.Parent as ZeroitBreadCrumb; while (c != null) { if (c == this) { return(true); } else { c = c.Parent as ZeroitBreadCrumb; } } } catch { } return(false); }