Exemple #1
0
 public Document(string title, Ganres ganre, Langs lang, DateTime publish, string pathToFile, Font font = null, PageSettings pg_settings = null)
 {
     DocumentName    = title;
     Ganre           = ganre;
     Lang            = lang;
     DateOfPublished = publish;
     _pages          = new List <PageContent>();
     if (pg_settings != null)
     {
         DefaultPageSettings = pg_settings;
     }
     else
     {
         DefaultPageSettings.PaperSize    = PaperStandards.GetSizeByName("A5");
         DefaultPageSettings.Landscape    = false;
         DefaultPageSettings.Margins.Left = PrinterUnitConvert.Convert(200, PrinterUnit.TenthsOfAMillimeter, PrinterUnit.Display);
         int short_margin = PrinterUnitConvert.Convert(100, PrinterUnit.TenthsOfAMillimeter, PrinterUnit.Display);
         DefaultPageSettings.Margins.Top = DefaultPageSettings.Margins.Bottom = DefaultPageSettings.Margins.Right = short_margin;
     }
     if (font != null)
     {
         _font = font;
     }
     else
     {
         _font = new Font("Arial", 14);
     }
     _storageReader = new StorageReader(pathToFile);
     _storageReader.eventHandler += OnReadLine;
     _storageReader.read_line();
 }
Exemple #2
0
 public StorageInfo(string pathToFile, string title, Genres genre, Langs lang, string paperFormat, string publisher, DateTime dateOfPublished)
 {
     Title        = title;
     Genre        = genre;
     Publisher    = publisher;
     _authors     = new List <Author>();
     _paperFormat = paperFormat;
     _pages       = StorageReader.getPages(pathToFile, PaperStrogeStandarts.getPaperInfo(_paperFormat));
 }
Exemple #3
0
 public StorageInfo(string pathToFile, string title, Genres genre, Langs lang, string paperFormat, string publisher, DateTime dateOfPublished, List <Author> authors)
 {
     _authors     = authors;
     _paperFormat = paperFormat;
     _pages       = StorageReader.getPages(pathToFile, PaperStrogeStandarts.getPaperInfo(_paperFormat));
 }