FairyGUI.Container.IsAncestorOf C# (CSharp) Method

IsAncestorOf() public method

public IsAncestorOf ( DisplayObject obj ) : bool
obj DisplayObject
return bool
        public bool IsAncestorOf(DisplayObject obj)
        {
            if (obj == null)
                return false;

            Container p = obj.parent;
            while (p != null)
            {
                if (p == this)
                    return true;

                p = p.parent;
            }
            return false;
        }

Usage Example

示例#1
0
 static public int IsAncestorOf(IntPtr l)
 {
     try {
         FairyGUI.Container     self = (FairyGUI.Container)checkSelf(l);
         FairyGUI.DisplayObject a1;
         checkType(l, 2, out a1);
         var ret = self.IsAncestorOf(a1);
         pushValue(l, true);
         pushValue(l, ret);
         return(2);
     }
     catch (Exception e) {
         return(error(l, e));
     }
 }
All Usage Examples Of FairyGUI.Container::IsAncestorOf