Example #1
0
        /// <summary>
        /// Start an invalidation call from this object on the specified channel.
        /// </summary>
        /// <param name="sender">Who call this invalidation.</param>
        /// <param name="channel">Channel to invalidate.</param>
        /// <param name="direction">Propagation direction.</param>
        public virtual void Invalidate(GameObject sender, string channel, InvalidationDirection direction)
        {
            bool propagate = OnInvalidation(sender, channel, direction);

            if (direction.HasFlag(InvalidationDirection.Parent) && Parent != null)
            {
                Parent.Invalidate(sender, channel, direction);
            }
        }
Example #2
0
        /// <summary>
        /// Invalidate a property of this object/tree.
        /// </summary>
        /// <param name="sender">Object sender.</param>
        /// <param name="channel">Channel to invalidate.</param>
        /// <param name="direction">Propagation direction.</param>
        public override void Invalidate(GameObject sender, string channel, InvalidationDirection direction)
        {
            base.Invalidate(sender, channel, direction);

            if (direction.HasFlag(InvalidationDirection.Children))
            {
                foreach (Drawable obj in Children)
                {
                    obj.Invalidate(sender, channel, InvalidationDirection.Children);
                }
            }
        }