Esempio n. 1
0
        public GetActors(int seriesID)
        {
            // check if local
            _actors = DBActor.GetAll(seriesID);

            // success
            if (_actors.Count != 0) return;

            // get cached actors or download
            XmlNode node = OnlineAPI.GetActorsList(seriesID);
            if (node == null) return;

            // add actors to database
            foreach (XmlNode actorNode in node.SelectNodes("/Actors/Actor"))
            {
                DBActor actor = new DBActor();

                actor[DBActor.cSeriesID] = seriesID;

                foreach (XmlNode propertyNode in actorNode)
                {
                    actor[propertyNode.Name] = propertyNode.InnerText;
                }
                actor.Commit();
                _actors.Add(actor);
            }

        }
Esempio n. 2
0
        public GetActors(int seriesID)
        {
            // check if local
            _actors = DBActor.GetAll(seriesID);

            // success
            if (_actors.Count != 0)
            {
                return;
            }

            // get cached actors or download
            XmlNode node = OnlineAPI.GetActorsList(seriesID);

            if (node == null)
            {
                return;
            }

            // add actors to database
            foreach (XmlNode actorNode in node.SelectNodes("/Actors/Actor"))
            {
                DBActor actor = new DBActor();

                actor[DBActor.cSeriesID] = seriesID;

                foreach (XmlNode propertyNode in actorNode)
                {
                    actor[propertyNode.Name] = propertyNode.InnerText;
                }
                actor.Commit();
                _actors.Add(actor);
            }
        }
Esempio n. 3
0
 private void PublishSkinProperties(DBActor actor)
 {
     SetProperty("Name", actor.Name);
     SetProperty("Role", actor.Role);
     SetProperty("SeriesID", actor.SeriesId.ToString());
     SetProperty("Image", actor.Image);
 }
Esempio n. 4
0
        DBActor.ActorData GetActorData(uint npcID)
        {
            DBActor db = DBManager.GetInstance().GetDB <DBActor>();

            if (db.ContainsKey(npcID) == false)
            {
                GameDebug.LogError("Record does't exist. npcID:" + npcID);
                return(null);
            }

            return(db.GetData(npcID));
        }
Esempio n. 5
0
        private void RefreshActors()
        {
            // clear facade
            GUIControl.ClearControl(GetID, FacadeActors.GetID);

            // delete thumbs
            DeleteActorThumbs();

            // clear properties
            ClearProperties();

            // delete this series actors from database
            DBActor.ClearDB(SeriesId);

            // reload
            DownloadActorsList();
        }
Esempio n. 6
0
 private void PublishSkinProperties(DBActor actor)
 {
     SetProperty("Name", actor.Name);
     SetProperty("Role", actor.Role);
     SetProperty("SeriesID", actor.SeriesId.ToString());
     SetProperty("Image", actor.Image);
 }
Esempio n. 7
0
        protected override void OnShowContextMenu()
        {
            GUIListItem selectedItem = this.FacadeActors.SelectedListItem;

            if (selectedItem == null)
            {
                return;
            }

            IDialogbox dlg = (IDialogbox)GUIWindowManager.GetWindow((int)GUIWindow.Window.WINDOW_DIALOG_MENU);

            dlg.Reset();
            dlg.SetHeading(Translation.Actors);

            GUIListItem listItem = null;

            // Trakt: Search for Actor
            if (Helper.IsTraktAvailableAndEnabled)
            {
                listItem = new GUIListItem(Translation.Biography);
                dlg.Add(listItem);
                listItem.ItemId = (int)ContextMenuItem.biography;
            }

            // MovingPictures: Search for Actor in Movies
            if (Helper.IsMovingPicturesAvailableAndEnabled)
            {
                listItem = new GUIListItem(Translation.SearchActorInMovies);
                dlg.Add(listItem);
                listItem.ItemId = (int)ContextMenuItem.searchmovie;
            }

            listItem = new GUIListItem(Translation.ChangeLayout + " ...");
            dlg.Add(listItem);
            listItem.ItemId = (int)ContextMenuItem.layout;

            // Show Context Menu
            dlg.DoModal(GUIWindowManager.ActiveWindow);
            if (dlg.SelectedId < 0)
            {
                return;
            }

            switch (dlg.SelectedId)
            {
            case ((int)ContextMenuItem.layout):
                ShowLayoutsMenu();
                break;

            case ((int)ContextMenuItem.searchmovie):
                DBActor actor     = (selectedItem as GUIActorListItem).Item as DBActor;
                string  searchObj = string.Format("searchcast:{0}", actor.Name);
                GUIWindowManager.ActivateWindow(96742, searchObj);
                break;

            // trakt actor search
            case ((int)ContextMenuItem.biography):
                actor = (selectedItem as GUIActorListItem).Item as DBActor;
                GUIWindowManager.ActivateWindow(874005, actor.Name);
                break;
            }

            base.OnShowContextMenu();
        }