UMD.HCIL.Piccolo.PNode.InvalidatePaint C# (CSharp) Method

InvalidatePaint() public method

Invalidate this node's paint, and mark all of its ancestors as having a node with invalid paint.
public InvalidatePaint ( ) : void
return void
		public virtual void InvalidatePaint() {
			PaintInvalid = true;

			PNode n = parent;
			while (n != null && !n.ChildPaintInvalid) {
				n.ChildPaintInvalid = true;
				n = n.Parent;
			}

			OnPaintInvalidated();
		}

Usage Example

Example #1
0
		/// <summary>
		/// Add a node to be a new child of this node at the specified index.
		/// </summary>
		/// <param name="index">The index at which to add the new child.</param>
		/// <param name="child">The new child to add to this node.</param>
		/// <remarks>
		/// If child was previously a child of another node, it is removed 
		/// from that node first.
		/// </remarks>
		public virtual void AddChild(int index, PNode child) {
			PNode oldParent = child.Parent;
			
			if (oldParent != null) {
				oldParent.RemoveChild(child);
			}

			child.Parent = this;
			ChildrenReference.Insert(index, child);
			child.InvalidatePaint();
			InvalidateFullBounds();

			FirePropertyChangedEvent(PROPERTY_KEY_CHILDREN, PROPERTY_CODE_CHILDREN, null, children);
		}