Ejemplo n.º 1
0
        private void btnSendToMylar_Click(object sender, EventArgs e)
        {
            CvVolume vol = (CvVolume)lstComicSearchResults.SelectedItem;

            MylarManager.AddComic(vol.Id.ToString());
            txtComicSeachText.Text = vol.Name;
            ClearAll();
            LoadData();
        }
Ejemplo n.º 2
0
        public static CvVolumeSearchResponse GetNewThisWeek()
        {
            CvVolumeSearchResponse response = new CvVolumeSearchResponse();

            response.Volumes = new List <CvVolume>();

            RestClient r = new RestClient("https://comicvine.gamespot.com/feeds/new-comics/");

            var request = new RestRequest("", Method.GET);


            XmlReaderSettings settings = new XmlReaderSettings();

            settings.DtdProcessing = DtdProcessing.Ignore;

            var    res     = r.Execute(request);
            string rawFeed = res.Content;

            var xDoc = XDocument.Parse(rawFeed); //XDocument.Load(filename)

            xDoc.Descendants("cache").ToList().ForEach(a => a.Remove());

            var newxml = xDoc.ToString();



            XmlReader xmlReader = XmlReader.Create(new StringReader(newxml), settings);


            SyndicationFeed feed = SyndicationFeed.Load(xmlReader);

            foreach (SyndicationItem item in feed.Items)
            {
                //get issue ID
                string[] uriChunks = item.Links[0].Uri.AbsoluteUri.Split('/');
                string   issueId   = uriChunks[uriChunks.Length - 2].Split('-')[1].Trim();
                CvIssue  issue     = GetIssue(issueId).Issue;

                CvVolume volume = issue.Volume;

                volume.Name += " Issue #" + issue.IssueNumber;
                response.Volumes.Add(volume);
            }

            return(response);
        }
Ejemplo n.º 3
0
        private void BindComic(CvVolume volume)
        {
            if (volume.Image?.LargeUrl == null)
            {
                volume = ComicVineManager.GetVolume(volume.Id.ToString()).Volume;
            }

            imgDetail.Image   = ImageCacheManager.GetImage(volume.Image.LargeUrl);
            lblComicName.Text = volume.Name;
            CvVolumeResponse v = new CvVolumeResponse();

            v.Volume           = volume;
            _currentVolume     = v;
            lblComicName.Text += @"  (" + _currentVolume.Volume.StartYear + @")";

            webDetails.DocumentText = "0";
            if (webDetails.Document != null)
            {
                webDetails.Document.OpenNew(true);
                webDetails.Document.Write(_currentVolume.Volume.Description);
            }

            webDetails.Refresh();

            if (_currentVolume.Volume.Publisher == null)
            {
                if (_currentVolume.Volume.Publisher != null)
                {
                    var pub = ComicVineManager.GetPublisher(_currentVolume.Volume.Publisher.Id);
                    imgPublisher.Image = ImageCacheManager.GetImage(pub.Publisher.Image.IconUrl);
                }
            }
            else
            {
                imgPublisher.Image = null;
            }
        }