Ejemplo n.º 1
0
        private void BuildData()
        {
            // find actors that have been in more than one thing
            // Dictionary<String^, List<String> ^> ^whoInWhat = gcnew Dictionary<String^, List<String> ^>;
            TheTVDB db = this.mDoc.GetTVDB(true, "Actors");

            this.TheData = new DataArr(db.GetSeriesDict().Count);
            foreach (System.Collections.Generic.KeyValuePair <int, SeriesInfo> ser in db.GetSeriesDict())
            {
                SeriesInfo si     = ser.Value;
                string     actors = si.GetItem("Actors");
                if (!string.IsNullOrEmpty(actors))
                {
                    foreach (string act in actors.Split('|'))
                    {
                        string aa = act.Trim();
                        if (!string.IsNullOrEmpty(aa))
                        {
                            this.TheData.Set(si.Name, aa, true);
                        }
                    }
                }

                if (this.cbGuestStars.Checked)
                {
                    foreach (System.Collections.Generic.KeyValuePair <int, Season> kvp in si.Seasons)
                    {
                        foreach (Episode ep in kvp.Value.Episodes)
                        {
                            string guest = ep.GetItem("GuestStars");

                            if (!string.IsNullOrEmpty(guest))
                            {
                                foreach (string g in guest.Split('|'))
                                {
                                    string aa = g.Trim();
                                    if (!string.IsNullOrEmpty(aa))
                                    {
                                        this.TheData.Set(si.Name, aa, false);
                                    }
                                }
                            }
                        }
                    }
                }
            }

            db.Unlock("Actors");
            this.TheData.RemoveEmpties();
        }