示例#1
0
 private Vector2 ChoosingStartDrawPoint(int index, Func <IPanelChild, Vector2> calcStarPoint)
 {
     if (index > 0)
     {
         IPanelChild prevChild = children[index - 1];
         return(calcStarPoint(prevChild));
     }
     return(startDrawPointFunc());
 }
示例#2
0
        public void AddChildren(IPanelChild child)
        {
            children.Add(child);
            int index = children.Count - 1;

            switch (direction)
            {
            case Direction.Down:
                child.StartDrawPointFunc = () => ChoosingStartDrawPoint(index, prevChild => prevChild.StartDrawPointFunc().Translate(prevChild.Margin.X, prevChild.Size.Height + prevChild.Margin.Y));
                break;

            case Direction.Left:
                child.StartDrawPointFunc = () => ChoosingStartDrawPoint(index, prevChild => prevChild.StartDrawPointFunc().Translate(-prevChild.Margin.X - prevChild.Size.Width, prevChild.Margin.Y));
                break;
            }
        }
示例#3
0
        public void AddChildren(IPanelChild child)
        {
            children.Add(child);
            int index = children.Count - 1;

            switch (direction)
            {
                case Direction.Down:
                    child.StartDrawPointFunc = () => ChoosingStartDrawPoint(index, prevChild => prevChild.StartDrawPointFunc().Translate(prevChild.Margin.X, prevChild.Size.Height + prevChild.Margin.Y));
                    break;
                case Direction.Left:
                    child.StartDrawPointFunc = () => ChoosingStartDrawPoint(index, prevChild => prevChild.StartDrawPointFunc().Translate(-prevChild.Margin.X - prevChild.Size.Width, prevChild.Margin.Y));
                    break;
            }
        }