Ejemplo n.º 1
0
            public static eVerticalAlign GetCheckBoxVerticalAlign(eCellPartAlignment align, eView view)
            {
                if (align == eCellPartAlignment.Default)
                {
                    if (view == eView.Tree)
                        align = eCellPartAlignment.NearCenter;
                    else if (view == eView.Tile)
                        align = eCellPartAlignment.NearCenter;
                }
                eVerticalAlign va = eVerticalAlign.Middle;

                switch (align)
                {
                    case eCellPartAlignment.FarBottom:
                    case eCellPartAlignment.NearBottom:
                    case eCellPartAlignment.CenterBottom:
                        va = eVerticalAlign.Bottom;
                        break;
                    case eCellPartAlignment.FarTop:
                    case eCellPartAlignment.NearTop:
                    case eCellPartAlignment.CenterTop:
                        va = eVerticalAlign.Top;
                        break;
                }

                return va;
            }
Ejemplo n.º 2
0
            public static eHorizontalAlign GetCheckBoxHorizontalAlign(eCellPartAlignment align, bool leftToRight, eView view)
            {
                if (align == eCellPartAlignment.Default)
                {
                    if (view == eView.Tree)
                        align = eCellPartAlignment.NearCenter;
                    else if (view == eView.Tile)
                        align = eCellPartAlignment.NearCenter;
                }

                if (((align == eCellPartAlignment.NearBottom || align == eCellPartAlignment.NearCenter ||
                     align == eCellPartAlignment.NearTop) && leftToRight) ||
                   ((align == eCellPartAlignment.FarBottom || align == eCellPartAlignment.FarCenter ||
                     align == eCellPartAlignment.FarTop) && !leftToRight))
                    return eHorizontalAlign.Left;
                else if (align == eCellPartAlignment.CenterBottom || align == eCellPartAlignment.CenterTop)
                    return eHorizontalAlign.Center;
                return eHorizontalAlign.Right;
            }