Exemple #1
0
        private void Actors_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            var  webget = new HtmlWeb();
            var  doc    = webget.Load(LinkFilm);
            bool con    = true;
            int  div    = 1;

            while (con)
            {
                string Actors = doc.DocumentNode.SelectSingleNode("//*[@id='profile']/div[1]/div[2]/div[1]/div[" + div + "]/h4[1]").InnerText;
                if (Actors == "Hrají:")
                {
                    con = false;
                }
                else
                {
                    div++;
                }
            }

            try
            {
                string LinkSource = doc.DocumentNode.SelectSingleNode("//*[@id='profile']/div[1]/div[2]/div[1]/div[" + div + "]/span[1]/a[" + (Actors.SelectedIndex + 1) + "]").OuterHtml;
                string Link       = "http://www.csfd.cz" + Regex.Split(Regex.Split(LinkSource, "<a href=\"")[1], "\">")[0];

                ArtCard  ACard   = (ArtCard)Actors.SelectedItem;
                Card_art PropArt = ACard.LoadCard(ACard, (new SearchClass()
                {
                    HDoc = webget.Load(Link)
                }).HDoc);
                PropArt.Client  = Client;
                PropArt.LinkAct = Link;
                PropArt.Title   = "Karta tvůrce: " + ACard.NameArt;
                PropArt.Show();
            }
            catch {}
        }
Exemple #2
0
        private void Find_CSFD_Click(object sender, RoutedEventArgs e)
        {
            bool SearchCSFDReuslt = false;
            bool Continue         = false;
            bool MoreSearches     = false;

            do
            {
                Search SearchCSFD = new Search();
                SearchCSFD.MoreSearches.IsChecked = MoreSearches;
                SearchCSFDReuslt = (bool)SearchCSFD.ShowDialog();
                MoreSearches     = (bool)SearchCSFD.MoreSearches.IsChecked;
                if (SearchCSFDReuslt)
                {
                    stav_prog("Program vyhledává: " + SearchCSFD.Find_box.Text);
                    Result vysldek = SClass.FindFilm(SearchCSFD.Find_box.Text, true);

                    if (vysldek.Films.Items.Count == 0)
                    {
                        vysldek.Exp1.IsExpanded = false;
                    }
                    else
                    {
                        vysldek.Exp1.IsExpanded = true;
                    }

                    if (vysldek.Actors.Items.Count == 0)
                    {
                        vysldek.Exp2.IsExpanded = false;
                    }
                    else
                    {
                        vysldek.Exp2.IsExpanded = true;
                    }

                    if ((bool)vysldek.ShowDialog())
                    {
                        if (vysldek.DB == "Films")
                        {
                            FilmCard FCard = new FilmCard();
                            string   name  = "";
                            string[] data  = FCard.LoadProperties(ref name, vysldek, SClass.HDoc);
                            data[5] += " min";
                            data[8]  = "Ne";
                            data[9]  = "Ne";
                            Card_film PropFilm = FCard.LoadCard(data);
                            PropFilm.Cancel.Visibility = Visibility.Visible;
                            PropFilm.seen.IsEnabled    = true;
                            PropFilm.DVD.IsEnabled     = true;
                            PropFilm.Client            = this;
                            PropFilm.Accept.Content    = "Přidat film do databáze";
                            PropFilm.ID        = IntelID(Filmy.Items);
                            PropFilm.pripojeni = pripojeni;
                            PropFilm.link      = data[6];
                            PropFilm.Show();
                        }
                        else
                        {
                            ArtCard  ACard   = new ArtCard();
                            var      data    = vysldek.ArtData;
                            Card_art PropArt = ACard.LoadCard(data, vysldek, SClass.HDoc);
                            PropArt.Client = this;
                            PropArt.Show();
                        }
                    }
                }
                else
                {
                    stav_prog("Spuštěn; Akce zrušena");
                }
                Continue = (MoreSearches == true) && (true == SearchCSFDReuslt);
            }while (Continue);
        }