Exemplo n.º 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();
 }
Exemplo n.º 2
0
        private void dGVGanres_CellMouseDoubleClick(object sender, DataGridViewCellMouseEventArgs e)
        {
            Ganres     ganre = (Ganres)dGVGanres.CurrentRow.DataBoundItem;
            SearchForm frm   = new SearchForm(ganre);

            frm.ShowDialog(this);
            frm.Dispose();
        }
        public SearchForm(Ganres ganre)
        {
            InitializeComponent();
            this.ganre = ganre;
            Text       = "Search in ganre: " + ganre.G_name;
            ctx        = new DBMusicEntities();

            FindSongs();
        }
Exemplo n.º 4
0
 private void bDGanres_Click(object sender, EventArgs e)
 {
     try
     {
         Ganres ganre   = (Ganres)dGVGanres.CurrentRow.DataBoundItem;
         var    g_count = (from g in ctx.SongGanre
                           where g.SG_ganreId == ganre.G_id
                           select g).Count();
         if (g_count > 0)
         {
             MessageBox.Show("Impossible to delete, ganre has songs", "Warning");
         }
         else
         {
             ganresBindingSource.RemoveCurrent();
         }
     }
     catch (Exception)
     {
         MessageBox.Show("Error of deleting information", "Error");
     }
 }
Exemplo n.º 5
0
 public Book(string title, Ganres ganre, Langs lang, DateTime publish, string pathToFile, Font font = null, PageSettings pg_settings = null)
     : base(title, ganre, lang, publish, pathToFile, font, pg_settings)
 {
 }