private PaperSize ShowSelectPaperSizeWindow(PaperSizeType defaultPaperSize) { PaperSize paperSize = null; SelectSettingWindow selectPaperSizeWindow = new SelectSettingWindow(SelectSettingWindow.Templete.PaperSize); selectPaperSizeWindow.SelectedIndex = (int)defaultPaperSize; bool?result = selectPaperSizeWindow.ShowDialog(); if (result == true) { paperSize = selectPaperSizeWindow.SelectedPaperSize; } return(paperSize); }
public PaperSize(PaperSizeType type) { Type = type; }
/// <summary> /// Convert Excel PaperSize to Word PaperSize /// </summary> /// <param name="excelPaperSize">Excel PaperSize</param> /// <returns>Word Paper size</returns> private PaperSize ConvertPaperSize(PaperSizeType excelPaperSize) { PaperSize paperSize = PaperSize.A4; switch (excelPaperSize) { case PaperSizeType.PaperA4: { paperSize = PaperSize.A4; break; } case PaperSizeType.PaperA3: { paperSize = PaperSize.A3; break; } case PaperSizeType.PaperA5: { paperSize = PaperSize.A5; break; } case PaperSizeType.PaperB4: { paperSize = PaperSize.B4; break; } case PaperSizeType.PaperB5: { paperSize = PaperSize.B5; break; } case PaperSizeType.Paper10x14: { paperSize = PaperSize.Paper10x14; break; } case PaperSizeType.Paper11x17: { paperSize = PaperSize.Paper11x17; break; } case PaperSizeType.PaperEnvelopeDL: { paperSize = PaperSize.EnvelopeDL; break; } case PaperSizeType.PaperExecutive: { paperSize = PaperSize.Executive; break; } case PaperSizeType.PaperFolio: { paperSize = PaperSize.Folio; break; } case PaperSizeType.PaperLedger: { paperSize = PaperSize.Ledger; break; } case PaperSizeType.PaperLegal: { paperSize = PaperSize.Legal; break; } case PaperSizeType.PaperLetter: { paperSize = PaperSize.Letter; break; } case PaperSizeType.PaperQuarto: { paperSize = PaperSize.Quarto; break; } case PaperSizeType.PaperStatement: { paperSize = PaperSize.Statement; break; } case PaperSizeType.PaperTabloid: { paperSize = PaperSize.Tabloid; break; } default: { paperSize = PaperSize.Letter; break; } } return paperSize; }