Ejemplo n.º 1
0
        private async Task LoadImage(int imageNumber = 0)
        {
            var comic = await ComicProcessor.LoadComic(imageNumber);

            if (imageNumber == 0)
            {
                maxNumber = comic.Num;
            }
            currentNumber = comic.Num;
            var uriSourve = new Uri(comic.Img, UriKind.Absolute);
        }
Ejemplo n.º 2
0
        public async Task LoadImage(int imageNumber = 0)
        {
            var comic = await ComicProcessor.LoadComic(imageNumber);

            if (imageNumber == 0)
            {
                maxNumber = comic.Num;
            }
            currentNumber = comic.Num;
            var uriSource = new Uri(comic.Img, UriKind.Absolute);

            comicImage.Source = new BitmapImage(uriSource, new RequestCachePolicy(RequestCacheLevel.CacheIfAvailable));
        }
Ejemplo n.º 3
0
        private async Task LoadComic(int comicNumber = 0)
        {
            var comic = await ComicProcessor.LoadComic(comicNumber);

            if (comicNumber == 0)
            {
                _maxNum = comicNumber;
            }
            _curNum = comicNumber;

            var uriImgSource = new Uri(comic.Img, UriKind.Absolute);

            imgComic.Source = new BitmapImage(uriImgSource);
        }
Ejemplo n.º 4
0
        private async Task LoadComic(int comicNumber = 0)
        {
            var comic = await ComicProcessor.LoadComic(comicNumber);

            if (comicNumber == 0)
            {
                _maxNum = comicNumber;
            }
            _curNum = comicNumber;

            var uriImgSource = new Uri(comic.Img, UriKind.Absolute);

            pbComicImg.ImageLocation = uriImgSource.ToString();// = new BitmapImage(uriImgSource);
        }
Ejemplo n.º 5
0
        private async Task LoadImage(int imageNumber = 0)
        {
            var comic = await ComicProcessor.LoadComic(imageNumber);

            if (imageNumber == 0)
            {
                maxNumber = comic.Num;
            }

            currentNumber = comic.Num;

            var uriSource = new Uri(comic.Img, UriKind.Absolute);

            pictureBox1.ImageLocation = uriSource.ToString();
        }
Ejemplo n.º 6
0
        private async Task LoadImage(int imageNumber = 0)
        {
            var comic = await ComicProcessor.LoadComic(imageNumber);

            if (imageNumber == 0)
            {
                MaxNumber = comic.Num;
            }

            CurrentNumber = comic.Num;

            var uriSource = new Uri(comic.Img, UriKind.Absolute);

            comicImage.Source = new BitmapImage(uriSource);
        }
Ejemplo n.º 7
0
        public async Task <ViewResult> Index()
        {
            APIHelper.InitializeClient();
            int id = 0;

            ComicModel comic = await ComicProcessor.LoadComic(id);

            currentNumber = comic.Num;
            maxNumber     = currentNumber;

            ViewBag.Id = currentNumber;

            comic.btnNextDisabled = true;
            comic.btnPrevDisabled = false;
            return(View(comic));
        }
Ejemplo n.º 8
0
        private async Task LoadImage(int imageNumber = 0)
        {
            var comic = await ComicProcessor.LoadComic(imageNumber);

            if (imageNumber == 0)
            {
                _maxNumber = comic.Num;
            }

            _currentNumber = comic.Num;

            var uriSource = new Uri(comic.Img, UriKind.Absolute);

            // Creates a bitmap image to be placed in the WPF based off the image url
            comicImage.Source = new BitmapImage(uriSource);
        }
Ejemplo n.º 9
0
        private async Task LoadImage(int imageNumber = 0)
        {
            // call our API
            var comic = await ComicProcessor.LoadComic(imageNumber);

            if (imageNumber == 0)
            {
                maxNumber = comic.Num;
            }

            currentNumber = comic.Num;

            // apply image to interface
            var uriSource = new Uri(comic.Img, UriKind.Absolute);

            comicImage.Source = new BitmapImage(uriSource);
        }
Ejemplo n.º 10
0
        private async Task LoadImage(int imageNumber = 0)
        {
            //loads image
            var comic = await ComicProcessor.LoadComic(imageNumber);

            if (imageNumber == 0)
            {
                maxNumber = comic.Num;
            }

            currentNumber = comic.Num;

            //grab the uri say its absolute and put it into the source
            var uriSource = new Uri(comic.Img, UriKind.Absolute);

            comicImage.Source = new BitmapImage(uriSource);
        }
Ejemplo n.º 11
0
        private async Task LoadImage(int imageNumber = 0)
        {
            var comic = await ComicProcessor.LoadComic(imageNumber);

            if (imageNumber == 0)
            {
                maxNumber = comic.Num;
            }

            currentNumber = comic.Num;

            if (currentNumber > 0)
            {
                btnPrev.Enabled = true;
            }

            var uriSource = new Uri(comic.Img, UriKind.Absolute);

            pictureBox1.Load(uriSource.AbsoluteUri);
        }
Ejemplo n.º 12
0
        public async Task <ViewResult> LoadImage(int id = 0)
        {
            if (id > maxNumber)
            {
                currentNumber = 0;
            }
            else
            {
                currentNumber = id;
            }

            ComicModel comic = await ComicProcessor.LoadComic(currentNumber);


            switch (currentNumber)
            {
            case 0:
                comic.btnNextDisabled = true;
                comic.btnPrevDisabled = false;
                break;

            case 1:
                comic.btnNextDisabled = false;
                comic.btnPrevDisabled = true;
                break;

            default:
                comic.btnNextDisabled = false;
                comic.btnPrevDisabled = false;
                break;
            }

            ViewBag.Id = currentNumber;

            return(View(comic));
        }
Ejemplo n.º 13
0
        private async Task LoadImage(int imageNumber = 0)
        {
            ComicModel comic = new ComicModel();

            try
            {
                comic = await ComicProcessor.LoadComic(imageNumber);
            }
            catch (Exception)
            {
                MessageBox.Show("Error!", "ComicProcessor");
            }

            if (imageNumber == 0)
            {
                maxNumber = comic.Num;
            }

            currentNumber = comic.Num;

            var uriSource = new Uri(comic.Img, UriKind.Absolute);

            pictureBox1.ImageLocation = uriSource.AbsoluteUri;
        }
Ejemplo n.º 14
0
 private async Task LoadImage(int imageNumber)
 {
     comics.Add(await ComicProcessor.LoadComic(imageNumber));
 }