コード例 #1
0
 /// <summary>
 /// Invalidate layout event
 /// </summary>
 public void Invalidate()
 {
     if (_suspendLayout == 0)
     {
         OnInvalidate?.Invoke(this, EventArgs.Empty);
     }
 }
コード例 #2
0
        /// <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);
        }
コード例 #3
0
ファイル: SkyMap.cs プロジェクト: Astrarium/Astrarium
 public void Invalidate()
 {
     if (!renderStopWatch.IsRunning)
     {
         OnInvalidate?.Invoke();
     }
 }
コード例 #4
0
 public void Invalidate()
 {
     if (!SuspendedLayout)
     {
         lock (_lock)
         {
             OnInvalidate?.Invoke(this, EventArgs.Empty);
         }
     }
 }
コード例 #5
0
ファイル: ClientCacheManager.cs プロジェクト: Jarre647/GPG
 public void Dispose()
 {
     if (OnInvalidate != null)
     {
         foreach (var d in OnInvalidate.GetInvocationList())
         {
             if (d != null)
             {
                 OnInvalidate -= (d as InvalidateCache);
             }
         }
     }
 }
コード例 #6
0
ファイル: Drawable.cs プロジェクト: TPGPL/osu-framework
        /// <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);
        }
コード例 #7
0
        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
        }
コード例 #8
0
 public void Invalidate()
 {
     OnInvalidate?.Invoke(this, EventArgs.Empty);
 }
コード例 #9
0
ファイル: ClientCacheManager.cs プロジェクト: Jarre647/GPG
 public async Task InvalidateCacheAsync()
 {
     await(OnInvalidate?.Invoke() ?? Task.CompletedTask);
 }
コード例 #10
0
ファイル: ModuleManager.cs プロジェクト: vsegrad/Console
 public static void Invalidate(Item item)
 {
     modulesListDirty = true;
     OnInvalidate?.Invoke(null, EventArgs.Empty);
 }
コード例 #11
0
        /// <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);
        }
コード例 #12
0
 public void Invalidate()
 {
     OnInvalidate?.Invoke();
 }