Example #1
0
        /// <summary>
        /// opens the singelton instance of addbook form
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void AddBook_Click(object sender, EventArgs e)
        {
            AddBooks addBooks = AddBooks.Instance();

            Utils.SwitchBetweenWindows(this, addBooks);
            // addBooks.ShowDialog();
        }
Example #2
0
 //implenting singelton pattern to this class
 public static AddBooks Instance(Book Book = null)
 {
     if (instance == null)
     {
         instance = new AddBooks();
     }
     instance.SetAsNewWindow(Book);
     return(instance);
 }
Example #3
0
        private void EditBook_Click(object sender, EventArgs e)
        {
            AddBooks addBooks = AddBooks.Instance(book);

            Utils.SwitchBetweenWindows(this, addBooks);
        }