コード例 #1
0
 public void TestInitialize()
 {
     if (reader == null)
     {
         reader        = new ComicReader();
         localTestFile = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, @"TestData\SampleCbr.cbr");
     }
 }
コード例 #2
0
        private void ComicView_Load(object sender, EventArgs e)
        {
            comReader = new ComicReader();

            //start of background thread stuff
            progDialog            = new ProgressDialog();
            backgroundProcessDone = false;
            bgWorker = new BackgroundWorker
            {
                WorkerReportsProgress      = true,
                WorkerSupportsCancellation = true
            };

            comReader.ReportProgress += ComicReader_ReportProgress;

            bgWorker.DoWork += delegate(object s, DoWorkEventArgs args)
            {
                comReader.OpenComicBook(comicPath);
            };

            bgWorker.RunWorkerAsync();
            progDialog.ShowDialog();
            //end of background thread stuff

            //wait for comic book to load
            while (!backgroundProcessDone)
            {
                ;
            }

            picBxComicScreen.SizeMode   = PictureBoxSizeMode.Zoom;
            panelComicScreen.AutoScroll = true;
            picBxComicScreen.Image      = comReader.GetCurrentPage();

            lblPageNumber.Text = "Page 1 of " + comReader.GetPageCount().ToString();
        }
コード例 #3
0
 /// <summary>
 /// provides an interface for reading comic book archives
 /// </summary>
 /// <param name="loggedInUser">
 /// the user who logged in
 /// </param>
 public ComicReadingInterface(User loggedInUser)
 {
     this.loggedInUser = loggedInUser;
     IsReadingComic    = false;
     comicReader       = new ComicReader();
 }