/// <summary> /// Invalidate layout event /// </summary> public void Invalidate() { if (_suspendLayout == 0) { OnInvalidate?.Invoke(this, EventArgs.Empty); } }
/// <summary> /// Invalidates draw matrix and autosize caches. /// </summary> /// <returns>If the invalidate was actually necessary.</returns> public virtual bool Invalidate(Invalidation invalidation = Invalidation.All, Drawable source = null, bool shallPropagate = true) { if (invalidation == Invalidation.None) { return(false); } OnInvalidate?.Invoke(); if (shallPropagate && Parent != null && source != Parent) { Parent.InvalidateFromChild(invalidation, this); } bool alreadyInvalidated = true; // Either ScreenSize OR ScreenPosition OR Colour if ((invalidation & (Invalidation.Geometry | Invalidation.Colour)) > 0) { if ((invalidation & Invalidation.SizeInParentSpace) > 0) { alreadyInvalidated &= !boundingSizeBacking.Invalidate(); } alreadyInvalidated &= !screenSpaceDrawQuadBacking.Invalidate(); alreadyInvalidated &= !drawInfoBacking.Invalidate(); } if (!alreadyInvalidated || (invalidation & Invalidation.DrawNode) > 0) { invalidationID = invalidationCounter.Increment(); } return(!alreadyInvalidated); }
public void Invalidate() { if (!renderStopWatch.IsRunning) { OnInvalidate?.Invoke(); } }
public void Invalidate() { if (!SuspendedLayout) { lock (_lock) { OnInvalidate?.Invoke(this, EventArgs.Empty); } } }
public void Dispose() { if (OnInvalidate != null) { foreach (var d in OnInvalidate.GetInvocationList()) { if (d != null) { OnInvalidate -= (d as InvalidateCache); } } } }
/// <summary> /// Invalidates draw matrix and autosize caches. /// </summary> /// <returns>If the invalidate was actually necessary.</returns> public virtual bool Invalidate(Invalidation invalidation = Invalidation.All, Drawable source = null, bool shallPropagate = true) { if (invalidation == Invalidation.None) { return(false); } ThreadSafety.EnsureUpdateThread(); OnInvalidate?.Invoke(); if (shallPropagate && Parent != null && source != Parent) { Parent.Invalidate(Parent.InvalidationEffectByChildren(invalidation), this, false); } bool alreadyInvalidated = true; // Either ScreenSize OR ScreenPosition OR Colour if ((invalidation & (Invalidation.Position | Invalidation.Colour | Invalidation.SizeInParentSpace)) > 0) { if ((invalidation & (Invalidation.Position | Invalidation.SizeInParentSpace)) > 0) { if ((invalidation & Invalidation.SizeInParentSpace) > 0) { alreadyInvalidated &= !boundingSizeBacking.Invalidate(); } alreadyInvalidated &= !screenSpaceDrawQuadBacking.Invalidate(); } alreadyInvalidated &= !drawInfoBacking.Invalidate(); } if ((invalidation & Invalidation.Visibility) > 0) { alreadyInvalidated &= !isVisibleBacking.Invalidate(); } if (!alreadyInvalidated) { foreach (DrawNode n in validDrawNodes) { n.IsValid = false; } validDrawNodes.Clear(); } return(!alreadyInvalidated); }
private async void Repository_DataChanged(object sender, ChangedPdfEventArgs e) { if (!invalidateInvoked && (currentFile == null || e.FileName == currentFile)) { // OnInvalidate should only be invoked once. invalidateInvoked = true; // reloading the PDF just after the file was changed can fail if the write is not completed -> wait 2 seconds await Task.Delay(2000); OnInvalidate?.Invoke(this, EventArgs.Empty); } // else: no interesting file changed or event already invoked }
public void Invalidate() { OnInvalidate?.Invoke(this, EventArgs.Empty); }
public async Task InvalidateCacheAsync() { await(OnInvalidate?.Invoke() ?? Task.CompletedTask); }
public static void Invalidate(Item item) { modulesListDirty = true; OnInvalidate?.Invoke(null, EventArgs.Empty); }
/// <summary> /// Invalidates draw matrix and autosize caches. /// </summary> /// <returns>If the invalidate was actually necessary.</returns> public virtual bool Invalidate(Invalidation invalidation = Invalidation.All, Drawable source = null, bool shallPropagate = true) { if (invalidation == Invalidation.None) { return(false); } ThreadSafety.EnsureUpdateThread(); OnInvalidate?.Invoke(); if (shallPropagate && Parent != null && source != Parent) { Parent.Invalidate(Parent.InvalidationEffectByChildren(invalidation), this, false); } bool alreadyInvalidated = true; if ((invalidation & Invalidation.SizeInParentSpace) > 0) { alreadyInvalidated &= !boundingSizeBacking.Invalidate(); } // Either ScreenSize OR ScreenPosition if ((invalidation & Invalidation.ScreenSpaceQuad) > 0) { alreadyInvalidated &= !screenSpaceDrawQuadBacking.Invalidate(); } // Either ScreenSize OR ScreenPosition OR Colour if ((invalidation & Invalidation.DrawInfo) > 0) { alreadyInvalidated &= !drawInfoBacking.Invalidate(); } if ((invalidation & Invalidation.Visibility) > 0) { alreadyInvalidated &= !isVisibleBacking.Invalidate(); } if (alreadyInvalidated || !shallPropagate) { return(!alreadyInvalidated); } if (children != null) { foreach (var c in children) { Debug.Assert(c != source); Invalidation childInvalidation = invalidation; //if (c.SizeMode == InheritMode.None) childInvalidation = childInvalidation & ~Invalidation.SizeInParentSpace; c.Invalidate(childInvalidation, this); } } return(!alreadyInvalidated); }
public void Invalidate() { OnInvalidate?.Invoke(); }