/// <summary> /// Loops through all child-elements for the element. /// </summary> /// <param name="Callback">Method called for each one of the elements.</param> /// <param name="State">State object passed on to the callback method.</param> /// <returns>If the operation was completed.</returns> public override bool ForEach(MarkdownElementHandler Callback, object State) { if (!Callback(this, State)) { return(false); } foreach (MarkdownElement[] Row in this.headers) { foreach (MarkdownElement E in Row) { if (E != null && !E.ForEach(Callback, State)) { return(false); } } } foreach (MarkdownElement[] Row in this.rows) { foreach (MarkdownElement E in Row) { if (E != null && !E.ForEach(Callback, State)) { return(false); } } } return(true); }
/// <summary> /// Loops through all child-elements for the element. /// </summary> /// <param name="Callback">Method called for each one of the elements.</param> /// <param name="State">State object passed on to the callback method.</param> /// <returns>If the operation was completed.</returns> public override bool ForEach(MarkdownElementHandler Callback, object State) { if (!Callback(this, State)) { return(false); } if (this.child != null && !this.child.ForEach(Callback, State)) { return(false); } return(true); }
/// <summary> /// Loops through all child-elements for the element. /// </summary> /// <param name="Callback">Method called for each one of the elements.</param> /// <param name="State">State object passed on to the callback method.</param> /// <returns>If the operation was completed.</returns> public override bool ForEach(MarkdownElementHandler Callback, object State) { if (!Callback(this, State)) { return(false); } if (this.children != null) { foreach (MarkdownElement E in this.children) { if (!E.ForEach(Callback, State)) { return(false); } } } return(true); }
/// <summary> /// Loops through all child-elements for the element. /// </summary> /// <param name="Callback">Method called for each one of the elements.</param> /// <param name="State">State object passed on to the callback method.</param> /// <returns>If the operation was completed.</returns> public virtual bool ForEach(MarkdownElementHandler Callback, object State) { return(Callback(this, State)); }