Ejemplo n.º 1
0
        /// <summary>
        /// Creates the collection of <see cref="IPrinterViewMargin"/> objects to place within a <see cref="IPrinterView"/>.
        /// </summary>
        /// <param name="view">The <see cref="IPrinterView"/> that will host the margins.</param>
        /// <returns>A <see cref="IPrinterViewMarginCollection"/> containing the <see cref="IPrinterViewMargin"/> objects that were created.</returns>
        public IPrinterViewMarginCollection CreateMargins(IPrinterView view)
        {
            IPrinterViewMarginCollection margins = new PrinterViewMarginCollection();

            // Add four margins
            margins.Add(new CustomMargin(view, PrinterViewMarginPlacement.Left));
            margins.Add(new CustomMargin(view, PrinterViewMarginPlacement.Top));
            margins.Add(new CustomMargin(view, PrinterViewMarginPlacement.Right));
            margins.Add(new CustomMargin(view, PrinterViewMarginPlacement.Bottom));

            return(margins);
        }
        /// <summary>
        /// Creates the collection of <see cref="IPrinterViewMargin"/> objects to place within a <see cref="IPrinterView"/>.
        /// </summary>
        /// <param name="view">The <see cref="IPrinterView"/> that will host the margins.</param>
        /// <returns>A <see cref="IPrinterViewMarginCollection"/> containing the <see cref="IPrinterViewMargin"/> objects that were created.</returns>
        public IPrinterViewMarginCollection CreateMargins(IPrinterView view)
        {
            IPrinterViewMarginCollection margins = new PrinterViewMarginCollection();

            margins.Add(new CustomMargin(view));
            return(margins);
        }