Example #1
0
        /// <summary>
        /// Returns a boolean indicating if the drawable is attached to this node
        /// If deep search is used, it only guarantees it is attached to a node in the subtree
        /// </summary>
        /// <param name="drawable">Drawable</param>
        /// <param name="deepSearch">Optionally search all children</param>
        /// <returns>If attached</returns>
        public virtual bool ContainsDrawable(gxtIDrawable drawable, bool deepSearch = false)
        {
            for (int i = 0; i < NumDrawables; i++)
            {
                if (drawables[i].Equals(drawable))
                    return true;
            }

            if (deepSearch)
            {
                for (int i = 0; i < NumChildrenNodes; i++)
                {
                    if (children[i].ContainsDrawable(drawable, true))
                        return true;
                }
            }
            return false;
        }
Example #2
0
 /// <summary>
 /// Detaches a drawable object from this node
 /// </summary>
 /// <param name="drawable">Drawable</param>
 /// <returns>If found and detached</returns>
 public virtual bool DetachDrawable(gxtIDrawable drawable)
 {
     for (int i = NumDrawables - 1; i >= 0; --i)
     {
         if (drawables[i].Equals(drawable))
         {
             drawables.RemoveAt(i);
             return true;
         }
     }
     return false;
 }
Example #3
0
 /// <summary>
 /// Attaches a drawable object to this node
 /// </summary>
 /// <param name="drawable">Drawable</param>
 public virtual void AttachDrawable(gxtIDrawable drawable)
 {
     gxtDebug.Assert(!drawables.Contains(drawable), "You cannot attach the same drawable to the same node more than once!");
     if (drawable != null)
         drawables.Add(drawable);
 }