示例#1
0
        /// <summary>
        /// Returns whether the given page in the given pagelayoutmode is left(-1), center(0) or right(+1) positioned on the canvas
        /// </summary>
        /// <param name="e">Active PageLayoutMode</param>
        /// <param name="pageNo">pageNumber</param>
        /// <returns></returns>
        public static int HorizontalPagePosition(TPageLayoutMode e, int pageNo)
        {
            switch (e)
            {
            case TPageLayoutMode.TwoColumnLeft:
            case TPageLayoutMode.TwoPageLeft:
                return(1 - 2 * (pageNo % 2));

            case TPageLayoutMode.TwoColumnRight:
            case TPageLayoutMode.TwoPageRight:
                return((pageNo == 1) ? 0 : -1 + 2 * (pageNo % 2));

            case TPageLayoutMode.OneColumn:
            case TPageLayoutMode.SinglePage:
            default:
                return(0);
            }
        }
示例#2
0
        public static bool PageLayoutScrollingEnabled(TPageLayoutMode e)
        {
            switch (e)
            {
            case TPageLayoutMode.SinglePage:
            case TPageLayoutMode.TwoPageLeft:
            case TPageLayoutMode.TwoPageRight:
                return(false);

            case TPageLayoutMode.TwoColumnLeft:
            case TPageLayoutMode.TwoColumnRight:
            case TPageLayoutMode.OneColumn:
                return(true);

            default:
                throw new ArgumentException();
            }
        }
示例#3
0
        public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
        {
            TPageLayoutMode mode = (TPageLayoutMode)value;

            switch (mode)
            {
            case TPageLayoutMode.TwoColumnLeft:
            case TPageLayoutMode.TwoPageLeft:
                return(ViewerWPFSample.Properties.MainWindowRes.doublee);

            case TPageLayoutMode.TwoColumnRight:
            case TPageLayoutMode.TwoPageRight:
                return(ViewerWPFSample.Properties.MainWindowRes.double_title);

            default:
                return(ViewerWPFSample.Properties.MainWindowRes.single);
            }
        }