Ejemplo n.º 1
0
 private static void SetAnchorValue(UIElement e, int edge, int val)
 {
     e.VerifyAccess();
     UIElement.Pair pair = e._anchorInfo;
     if (pair == null)
     {
         pair          = new UIElement.Pair();
         e._anchorInfo = pair;
     }
     if ((edge & 3) != 0)
     {
         pair._first   = val;
         pair._status &= -4;
     }
     else
     {
         pair._second  = val;
         pair._status &= -13;
     }
     pair._status |= edge;
     if (e.Parent != null)
     {
         e.Parent.InvalidateArrange();
     }
 }
Ejemplo n.º 2
0
        private static void SetAnchorValue(UIElement e, int edge, int val)
        {
            e.VerifyAccess();

            UIElement.Pair anchorInfo = e._anchorInfo;
            if (anchorInfo == null)
            {
                anchorInfo = new UIElement.Pair();
                e._anchorInfo = anchorInfo;
            }

            if ((edge & Edge_LeftRight) != 0)
            {
                anchorInfo._first = val;
                anchorInfo._status &= ~Edge_LeftRight;
            }
            else
            {
                anchorInfo._second = val;
                anchorInfo._status &= ~Edge_TopBottom;
            }

            anchorInfo._status |= edge;

            if (e.Parent != null)
            {
                e.Parent.InvalidateArrange();
            }
        }
Ejemplo n.º 3
0
        protected override void ArrangeOverride(int arrangeWidth, int arrangeHeight)
        {
            base.VerifyAccess();
            UIElementCollection elements = base._logicalChildren;

            if (elements != null)
            {
                int count = elements.Count;
                for (int i = 0; i < count; i++)
                {
                    int       num3;
                    int       num4;
                    UIElement element = elements[i];
                    element.GetDesiredSize(out num3, out num4);
                    UIElement.Pair pair = element._anchorInfo;
                    if (pair != null)
                    {
                        int num5 = pair._status;
                        element.Arrange(((num5 & 2) != 0) ? ((arrangeWidth - num3) - pair._first) : pair._first, ((num5 & 8) != 0) ? ((arrangeHeight - num4) - pair._second) : pair._second, num3, num4);
                    }
                    else
                    {
                        element.Arrange(0, 0, num3, num4);
                    }
                }
            }
        }
Ejemplo n.º 4
0
        private static void SetAnchorValue(UIElement e, int edge, int val)
        {
            e.VerifyAccess();

            var anchorInfo = e._anchorInfo;

            if (anchorInfo == null)
            {
                anchorInfo    = new UIElement.Pair();
                e._anchorInfo = anchorInfo;
            }

            if ((edge & Edge_LeftRight) != 0)
            {
                anchorInfo._first   = val;
                anchorInfo._status &= ~Edge_LeftRight;
            }
            else
            {
                anchorInfo._second  = val;
                anchorInfo._status &= ~Edge_TopBottom;
            }

            anchorInfo._status |= edge;

            if (e.Parent != null)
            {
                e.Parent.InvalidateArrange();
            }
        }
Ejemplo n.º 5
0
        protected override void ArrangeOverride(int arrangeWidth, int arrangeHeight)
        {
            VerifyAccess();

            UIElementCollection children = _logicalChildren;

            if (children != null)
            {
                int count = children.Count;
                for (int i = 0; i < count; i++)
                {
                    UIElement child = children[i];

                    int childWidth, childHeight;
                    child.GetDesiredSize(out childWidth, out childHeight);

                    UIElement.Pair anchorInfo = child._anchorInfo;
                    if (anchorInfo != null)
                    {
                        int status = anchorInfo._status;
                        child.Arrange(
                            ((status & Edge_Right) != 0) ? arrangeWidth - childWidth - anchorInfo._first : anchorInfo._first,
                            ((status & Edge_Bottom) != 0) ? arrangeHeight - childHeight - anchorInfo._second : anchorInfo._second,
                            childWidth,
                            childHeight);
                    }
                    else
                    {
                        child.Arrange(0, 0, childWidth, childHeight);
                    }
                }
            }
        }
Ejemplo n.º 6
0
 private static int GetAnchorValue(UIElement e, int edge)
 {
     UIElement.Pair pair = e._anchorInfo;
     if ((pair == null) || ((pair._status & edge) == 0))
     {
         return(0);
     }
     if ((edge & 3) == 0)
     {
         return(pair._second);
     }
     return(pair._first);
 }
Ejemplo n.º 7
0
        private static int GetAnchorValue(UIElement e, int edge)
        {
            UIElement.Pair anchorInfo = e._anchorInfo;
            if (anchorInfo != null)
            {
                if ((anchorInfo._status & edge) != 0)
                {
                    return(((edge & Edge_LeftRight) != 0) ? anchorInfo._first : anchorInfo._second);
                }
            }

            return(0);
        }