Example #1
0
        public AddBook(book book)
        {
            InitializeComponent();
            BookPath           = book.bookpath;
            BookPathLabel.Text = BookPath + "\\";
            worker.WorkerSupportsCancellation = true;
            worker.WorkerReportsProgress      = true;
            worker.ProgressChanged           += Worker_ProgressChanged;
            worker.DoWork += Worker_DoWork;
            //Fill in Book Details
            BookTitleText.Text     = book.title;
            SeriesNameText.Text    = book.seriesName;
            SeriesOrdinalText.Text = book.seriesOrdinal;
            AuthorText.Text        = book.authors[0].author;
            PublisherText.Text     = book.publisher;
            DescriptionText.Text   = book.description;
            WebsiteText.Text       = book.links[0].link.target;
            WebInfoText.Text       = book.links[0].link.weblinkdescription;
            AddNoteText.Text       = book.links[0].note;

            //Load the Cover Image
            try
            {
                CoverpictureBox.Load(BookPath + "\\" + "cover.jpg");
                NewCover = false;
            }
            catch (Exception ex)
            {
                NewCover = false;
            }

            //Load the Back Image
            try
            {
                BackpictureBox.Load(BookPath + "\\" + "back.jpg");
                NewBack = false;
            }
            catch (Exception ex)
            {
                NewBack = false;
            }

            //Load the Spine Image
            try
            {
                SpinepictureBox.Load(BookPath + "\\" + "spine.jpg");
                NewSpine = false;
            }
            catch (Exception ex)
            {
                NewSpine = false;
            }

            selectEPUB.Enabled      = false;
            button1.Enabled         = true;
            ModelType.SelectedIndex = book.model;
            ModelType.Enabled       = false;
            EditMode = true;
        }
Example #2
0
 public AddBook(Book book)
 {
     InitializeComponent();
     bookCtrl           = book;
     BookPath           = book.BookPath;
     BookPathLabel.Text = BookPath + "\\";
     worker.WorkerSupportsCancellation = true;
     worker.WorkerReportsProgress      = true;
     worker.ProgressChanged           += Worker_ProgressChanged;
     worker.DoWork += Worker_DoWork;
     //Fill in Book Details
     BookTitleText.Text     = book.Title;
     SeriesNameText.Text    = book.SeriesName;
     SeriesOrdinalText.Text = book.SeriesOrdinal;
     AuthorText.Text        = book.Authors[0].Author;
     PublisherText.Text     = book.Publisher;
     DescriptionText.Text   = book.Description;
     WebsiteText.Text       = book.Links[0].Link == null ? string.Empty : book.Links[0].Link.Target;
     WebInfoText.Text       = book.Links[0].Link == null ? string.Empty : book.Links[0].Link.WebLinkDescription;
     AddNoteText.Text       = string.IsNullOrEmpty(book.Links[0].Note) ? string.Empty : book.Links[0].Note;
     //Load the Cover Image
     try
     {
         CoverpictureBox.Load(BookPath + "\\" + "cover.jpg");
         NewCover = false;
     }
     catch (Exception ex)
     {
         NewCover = false;
     }
     //Load the Back Image
     try
     {
         BackpictureBox.Load(BookPath + "\\" + "back.jpg");
         NewBack = false;
     }
     catch (Exception ex)
     {
         NewBack = false;
     }
     //Load the Spine Image
     try
     {
         SpinepictureBox.Load(BookPath + "\\" + "spine.jpg");
         NewSpine = false;
     }
     catch (Exception ex)
     {
         NewSpine = false;
     }
     selectEPUB.Enabled      = false;
     button1.Enabled         = true;
     ModelType.SelectedIndex = book.Model;
     ModelType.Enabled       = false;
     EditMode          = true;
     checkBox1.Checked = !EditMode;
     checkBox1.Enabled = !EditMode;
 }