Esempio n. 1
0
        public float MinWidth()
        {
            float MINW = 1;

            if (ChildrenCount == 0)
            {
                return(MINW);
            }

            Surface firstChild = FirstChild();

            if (ChildrenCount == 1)
            {
                if (firstChild != null)
                {
                    MINW = firstChild.MinWidth();
                }
                else
                {
                    PNode nodeChild = GetChild(0);
                    if (nodeChild is Sash)
                    {
                        MINW = ((Sash)nodeChild).MinWidth();
                    }
                }
            }
            else if (Layout == SurfaceLayout.HORIZONTAL)
            {
                foreach (Surface child in SurfaceChildrenReference)
                {
                    Mullion nextMullion;
                    if ((nextMullion = child.NextMullion()) != null)
                    {
                        MINW += child.Model.Width + nextMullion.Thickness;
                    }
                    else
                    {
                        MINW += child.MinWidth();
                    }
                }
            }
            else
            {
                float minWidth;
                foreach (Surface child in SurfaceChildrenReference)
                {
                    if ((minWidth = child.MinWidth()) > MINW)
                    {
                        MINW = minWidth;
                    }
                }
            }


            return(MINW);
        }
Esempio n. 2
0
 /// <summary>
 /// Minimum width of the aFrame
 /// </summary>
 /// <returns></returns>
 public double MinWidth()
 {
     if (Surface != null)
     {
         return(FrameThickness * 2 + Surface.MinWidth());
     }
     else
     {
         return(FrameThickness * 2);
     }
 }
Esempio n. 3
0
        public float MinX()
        {
            Surface previous = PreviousSurface();

            if (previous != null)
            {
                return(previous.X + previous.MinWidth());
            }

            return(-1);
        }