Ejemplo n.º 1
0
        public static string GetNumber(DesignEntry entry)
        {
            string number = "";

            PageSetup pageSetup = PageSetup.Get();

            if (pageSetup.Catalog == Catalog.None)
            {
                number = entry.Number;
            }
            else
            {
                switch (pageSetup.Catalog)
                {
                case Catalog.Scott:
                    number = entry.Sc;
                    break;

                case Catalog.Michel:
                    number = entry.Mi;
                    break;

                case Catalog.Yvert:
                    number = entry.Yv;
                    break;

                case Catalog.Gibbons:
                    number = entry.Sg;
                    break;

                case Catalog.Chan:
                    number = entry.Ch;
                    break;

                case Catalog.Afinsa:
                    number = entry.Af;
                    break;

                case Catalog.Maury:
                    number = entry.Ma;
                    break;

                case Catalog.Newfoundland:
                    number = entry.Nc;
                    break;

                case Catalog.Afa:
                    number = entry.Afa;
                    break;

                case Catalog.Facit:
                    number = entry.Fac;
                    break;
                }

                if (pageSetup.AppendCatalog && number != "")
                {
                    number = entry.Number + " </b>(" + number + ")";
                }
            }

            return(number);
        }
Ejemplo n.º 2
0
        private void Initialize()
        {
            this.Text = App.GetName() + " · Print " + (printMode == PrintMode.ToScreen ? "Preview" : "Document");

            buttonOk.Text = (printMode == PrintMode.ToScreen ? "Preview" : "Print");

            groupBoxAlbumOptions.Enabled = (printMode == PrintMode.ToDocument);
            groupBoxPrinter.Enabled      = groupBoxAlbumOptions.Enabled;

            string printerName = App.GetSetting("PDFPrinter");

            textPrinter.Text = printerName;

            bool printerExists = PrinterSettings.InstalledPrinters.Cast <string>().Any(name => printerName.ToUpper().Trim() == name.ToUpper().Trim());

            labelPrinter.Visible = !printerExists;

            if (printMode == PrintMode.ToDocument)
            {
                buttonOk.Enabled = printerExists;
            }
            else
            {
                buttonOk.Enabled = true;
            }

            PageSetup pageSetup = PageSetup.Get();

            // Format

            comboBoxFormat.Items.AddRange(PageFormats.Get().Select(format => format.FormatName).ToArray());
            comboBoxFormat.Text = pageSetup.PageFormat.FormatName;
            checkBoxIncludeMarginForPunchHoles.Checked = pageSetup.IncludeMarginForPunchHoles;

            // Stamps Options

            checkBoxIncludeImage.Checked  = pageSetup.IncludeImage;
            checkBoxIncludeNumber.Checked = pageSetup.IncludeNumber;
            checkBoxIncludeValue.Checked  = pageSetup.IncludeValueAndColor;

            // Frame Options

            switch (pageSetup.FrameStyle)
            {
            case FrameStyle.ThinSolid:
                radioButtonThinSolid.Checked = true;
                break;

            case FrameStyle.Thick:
                radioButtonThick.Checked = true;
                break;

            case FrameStyle.ThinDotted:
                radioButtonThinDotted.Checked = true;
                break;
            }

            // Color Options

            switch (pageSetup.ColorStyle)
            {
            case ColorStyle.Greyscale:
                radioButtonGreyscale.Checked = true;
                break;

            case ColorStyle.Color:
                radioButtonColor.Checked = true;
                break;
            }

            // Font Options

            switch (pageSetup.FontSize)
            {
            case FontSize.Small:
                radioButtonSmall.Checked = true;
                break;

            case FontSize.Medium:
                radioButtonMedium.Checked = true;
                break;

            case FontSize.Large:
                radioButtonLarge.Checked = true;
                break;
            }

            // Page Options

            checkBoxIncludeBorder.Checked = pageSetup.IncludeBorder;
            checkBoxIncludeTitle.Checked  = pageSetup.IncludeTitle;

            // Catalog Options

            comboBoxCatalog.Items.AddRange(Catalogs.Get());
            comboBoxCatalog.Text          = Catalogs.Convert(pageSetup.Catalog);
            checkBoxAppendCatalog.Checked = pageSetup.AppendCatalog;

            // Album Options

            checkBoxIncludeSamplePagesOnly.Checked = pageSetup.IncludeSamplePagesOnly;
            checkBoxIncludePdfImage.Checked        = pageSetup.IncludePdfImages;
            checkBoxIncludePdfBookmarks.Checked    = pageSetup.IncludePdfBookmarks;

            // Real life page scale

            numericRealLifePageScale.Value = pageSetup.RealLifePageScale;

            if (this.excludeNumber)
            {
                checkBoxIncludeNumber.Checked = false;
                checkBoxIncludeNumber.Enabled = false;
            }

            if (this.excludeValueAndColor)
            {
                checkBoxIncludeValue.Checked = false;
                checkBoxIncludeValue.Enabled = false;
            }
        }