public MainForm()
        {
            InitializeComponent();

            Global.Settings.Load();

            Global.DB = new EntityContext("db.sdf");
            Global.DB.Categories.ToArray();
            Global.DB.Articles.ToArray();

            ApplySettings();

            buttonSave.Enabled = false;

            UpdateCategories();
            UpdateArticles();

            frmCategories = new CategoriesForm();
            frmCategories.CategoriesChanged += new EventHandler(frmCategories_CategoriesChanged);

            listArticles_SelectedIndexChanged(this, null);
        }
 private void btnShowCategories_Click(object sender, EventArgs e)
 {
     CategoriesForm frm = new CategoriesForm(DB.Categories);
     frm.ShowDialog();
     UpdateBookCategory();
     UpdateBooks();
     backgroundSave.RunWorkerAsync();
 }