当前位置: 首页>>代码示例>>C#>>正文


C# Library.GUIListItem类代码示例

本文整理汇总了C#中MediaPortal.GUI.Library.GUIListItem的典型用法代码示例。如果您正苦于以下问题:C# GUIListItem类的具体用法?C# GUIListItem怎么用?C# GUIListItem使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


GUIListItem类属于MediaPortal.GUI.Library命名空间,在下文中一共展示了GUIListItem类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Update

 private void Update()
 {
   listChannels.Clear();
   IList<Channel> channels = Channel.ListAll();
   foreach (Channel chan in channels)
   {
     if (chan.IsTv)
     {
       continue;
     }
     bool isDigital = false;
     foreach (TuningDetail detail in chan.ReferringTuningDetail())
     {
       if (detail.ChannelType != 0)
       {
         isDigital = true;
         break;
       }
     }
     if (isDigital)
     {
       GUIListItem item = new GUIListItem();
       item.Label = chan.DisplayName;
       item.IsFolder = false;
       item.ThumbnailImage = Utils.GetCoverArt(Thumbs.TVChannel, chan.DisplayName);
       item.IconImage = Utils.GetCoverArt(Thumbs.TVChannel, chan.DisplayName);
       item.IconImageBig = Utils.GetCoverArt(Thumbs.TVChannel, chan.DisplayName);
       item.Selected = chan.GrabEpg;
       item.TVTag = chan;
       listChannels.Add(item);
     }
   }
 }
开发者ID:npcomplete111,项目名称:MediaPortal-1,代码行数:33,代码来源:TvEpgSettings.cs

示例2: MissingEpisodes

    public List<GUIListItem> MissingEpisodes(string Pretty_Name)
    {
      SQLiteResultSet sqlResults = sqlClient.Execute("SELECT CompositeID, SeasonIndex, EpisodeIndex, EpisodeName FROM online_episodes WHERE SeriesID=\"" + sqlClient.Execute("SELECT id FROM online_series WHERE Pretty_Name=\"" + Pretty_Name + "\"").Rows[0].fields[0].ToString() + "\" ORDER BY SeasonIndex, EpisodeIndex");

      List<GUIListItem> _Results = new List<GUIListItem>();
      GUIListItem _Item = new GUIListItem();

      SQLiteResultSet sqlEpisodes;

      for (int i = 0; i < sqlResults.Rows.Count; i++)
      {
        sqlEpisodes = sqlClient.Execute("SELECT CompositeID FROM local_episodes WHERE CompositeID=\"" + sqlResults.Rows[i].fields[0] + "\"");

        if (sqlEpisodes.Rows.Count == 0)
        {
          _Item = new GUIListItem();

          _Item.DVDLabel = "[S]" + sqlResults.Rows[i].fields[1].ToString().PadLeft(2, '0') + "[E]" + sqlResults.Rows[i].fields[2].ToString().PadLeft(2, '0');
          _Item.Label = _Item.DVDLabel.Replace("[S]0", String.Empty).Replace("[S]", String.Empty).Replace("[E]", "x");

          _Results.Add(_Item);
        }
      }

      return _Results;
    }
开发者ID:DustinBrett,项目名称:mpNZB,代码行数:26,代码来源:MPTVSeries.cs

示例3: Add

 public void Add(PlayListItem item)
 {
     _playlist.Add(item);
     GUIListItem guiItem = new GUIListItem();
     guiItem.Label = item.Description;
     _playlistDic.Add(guiItem, item);
     playlistControl.Add(guiItem);
 }
开发者ID:troop,项目名称:MP-Jinzora-Plugin,代码行数:8,代码来源:PlayListGUI.cs

示例4: Add

        public new void Add(string strLabel)
        {
            int iItemIndex = ListItems.Count + 1;
              GUIListItem pItem = new GUIListItem {ItemId = iItemIndex};
              ListItems.Add(pItem);

              base.Add(strLabel);
        }
开发者ID:GuzziMP,项目名称:my-films,代码行数:8,代码来源:GUIDialogImageSelect.cs

示例5: Add

        public new void Add(string strLabel)
        {
            int iItemIndex = ListItems.Count + 1;
            GUIListItem pItem = new GUIListItem();
            if (base.ShowQuickNumbers)
                pItem.Label = iItemIndex.ToString() + " " + strLabel;
            else
                pItem.Label = strLabel;

            pItem.ItemId = iItemIndex;
            ListItems.Add(pItem);

            base.Add(strLabel);
        }
开发者ID:oetspoker,项目名称:subcentral,代码行数:14,代码来源:GUIDialogMultiSelect.cs

示例6: Feeds

    public List<GUIListItem> Feeds(XmlDocument xmlDoc, string _Site)
    {
      List<GUIListItem> _Return = new List<GUIListItem>();

      GUIListItem _Item;

      foreach (XmlNode nodeItem in xmlDoc.SelectNodes("sites/suggestion[@name='" + _Site + "']/feeds/feed"))
      {
        _Item = new GUIListItem(nodeItem.Attributes["name"].InnerText);
        _Item.Path = nodeItem.InnerText;

        _Return.Add(_Item);
      }

      return _Return;
    }
开发者ID:DustinBrett,项目名称:mpNZB,代码行数:16,代码来源:Suggestions.cs

示例7: GetTVSeriesAttributes

        // -> TV Series name ...
        internal static string GetTVSeriesAttributes(GUIListItem currentitem, ref string sGenre, ref string sStudio)
        {
            sGenre = string.Empty;
              sStudio = string.Empty;

              if (currentitem == null || currentitem.TVTag == null)
              {
            return string.Empty;
              }

              try
              {
            DBSeries selectedSeries = null;
            DBSeason selectedSeason = null;
            DBEpisode selectedEpisode = null;

            if (currentitem.TVTag is DBSeries)
            {
              selectedSeries = (DBSeries)currentitem.TVTag;
            }
            else if (currentitem.TVTag is DBSeason)
            {
              selectedSeason = (DBSeason)currentitem.TVTag;
              selectedSeries = Helper.getCorrespondingSeries(selectedSeason[DBSeason.cSeriesID]);
            }
            else if (currentitem.TVTag is DBEpisode)
            {
              selectedEpisode = (DBEpisode)currentitem.TVTag;
              selectedSeason = Helper.getCorrespondingSeason(selectedEpisode[DBEpisode.cSeriesID], selectedEpisode[DBEpisode.cSeasonIndex]);
              selectedSeries = Helper.getCorrespondingSeries(selectedEpisode[DBEpisode.cSeriesID]);
            }

            if (selectedSeries != null)
            {
              string result = selectedSeries[DBOnlineSeries.cPrettyName].ToString() + "|" + selectedSeries[DBOnlineSeries.cOriginalName].ToString();
              sGenre = selectedSeries[DBOnlineSeries.cGenre];
              sStudio = selectedSeries[DBOnlineSeries.cNetworkID];
              return result;
            }
              }
              catch (Exception ex)
              {
            logger.Error("GetTVSeriesAttributes: " + ex);
              }
              return string.Empty;
        }
开发者ID:hkjensen,项目名称:mediaportal-fanart-handler,代码行数:47,代码来源:UtilsTVSeries.cs

示例8: AddConflictRecording

    public void AddConflictRecording(GUIListItem item)
    {
      string logo = MediaPortal.Util.Utils.GetCoverArt(Thumbs.TVChannel, item.Label3);
      if (!MediaPortal.Util.Utils.FileExistsInCache(logo))      
      {
        logo = "defaultVideoBig.png";
      }
      item.ThumbnailImage = logo;
      item.IconImageBig = logo;
      item.IconImage = logo;
      item.OnItemSelected += OnListItemSelected;

      GUIListControl list = (GUIListControl)GetControl((int)Controls.LIST);
      if (list != null)
      {
        list.Add(item);
      }
    }
开发者ID:npcomplete111,项目名称:MediaPortal-1,代码行数:18,代码来源:TVConflictDialog.cs

示例9: addVideos

        protected void addVideos(YouTubeFeed videos, YouTubeQuery qu)
        {
            downloaQueue.Clear();
              foreach (YouTubeEntry entry in videos.Entries)
              {
            GUIListItem item = new GUIListItem();
            // and add station name & bitrate
            item.Label = entry.Title.Text; //ae.Entry.Author.Name + " - " + ae.Entry.Title.Content;
            item.Label2 = "";
            item.IsFolder = false;

            try
            {
              item.Duration = Convert.ToInt32(entry.Duration.Seconds, 10);
              if (entry.Rating != null)
            item.Rating = (float)entry.Rating.Average;
            }
            catch
            {

            }

            string imageFile = Youtube2MP.GetLocalImageFileName(GetBestUrl(entry.Media.Thumbnails));
            if (File.Exists(imageFile))
            {
              item.ThumbnailImage = imageFile;
              item.IconImage = imageFile;
              item.IconImageBig = imageFile;
            }
            else
            {
              MediaPortal.Util.Utils.SetDefaultIcons(item);
              item.OnRetrieveArt += item_OnRetrieveArt;
              DownloadImage(GetBestUrl(entry.Media.Thumbnails), item);
              //DownloadImage(GetBestUrl(entry.Media.Thumbnails), item);
            }
            item.MusicTag = entry;
            relatated.Add(item);
              }
              //OnDownloadTimedEvent(null, null);
        }
开发者ID:andrewjswan,项目名称:youtube-fm-for-mediaportal,代码行数:41,代码来源:YouTubeGuiInfoBase.cs

示例10: GetListDetailsFromUser

        /// <summary>
        /// Get all details needed to create a new list or edit existing list
        /// </summary>
        /// <param name="list">returns list details</param>
        /// <returns>true if list details completed</returns>
        public static bool GetListDetailsFromUser(ref TraktListDetail list)
        {
            // the list will have ids if it exists online
            bool editing = list.Ids != null;

            // Show Keyboard for Name of list
            string name = editing ? list.Name : string.Empty;
            if (!GUIUtils.GetStringFromKeyboard(ref name)) return false;
            if ((list.Name = name) == string.Empty) return false;

            // Skip Description and get Privacy...this requires a custom dialog as
            // virtual keyboard does not allow very much text for longer descriptions.
            // We may create a custom dialog for this in future
            var items = new List<GUIListItem>();
            var item = new GUIListItem();
            int selectedItem = 0;

            // Public
            item = new GUIListItem { Label = Translation.PrivacyPublic, Label2 = Translation.Public };
            if (list.Privacy == "public") { selectedItem = 0; item.Selected = true; }
            items.Add(item);
            // Private
            item = new GUIListItem { Label = Translation.PrivacyPrivate, Label2 = Translation.Private };
            if (list.Privacy == "private") { selectedItem = 1; item.Selected = true; }
            items.Add(item);
            // Friends
            item = new GUIListItem { Label = Translation.PrivacyFriends, Label2 = Translation.Friends };
            if (list.Privacy == "friends") { selectedItem = 2; item.Selected = true; }
            items.Add(item);

            selectedItem = GUIUtils.ShowMenuDialog(Translation.Privacy, items, selectedItem);
            if (selectedItem == -1) return false;

            list.Privacy = GetPrivacyLevelFromTranslation(items[selectedItem].Label2);

            // Skip 'Show Shouts' and 'Use Numbering' until we have Custom Dialog for List edits

            return true;
        }
开发者ID:trakt,项目名称:Trakt-for-Mediaportal,代码行数:44,代码来源:TraktLists.cs

示例11: GetListDetailsFromUser

        /// <summary>
        /// Get all details needed to create a new list or edit existing list
        /// </summary>
        /// <param name="list">returns list details</param>
        /// <returns>true if list details completed</returns>
        public static bool GetListDetailsFromUser(ref TraktList list)
        {
            list.UserName = TraktSettings.Username;
            list.Password = TraktSettings.Password;

            bool editing = !string.IsNullOrEmpty(list.Slug);

            // Show Keyboard for Name of list
            string name = editing ? list.Name : string.Empty;
            if (!GUIUtils.GetStringFromKeyboard(ref name)) return false;
            if ((list.Name = name) == string.Empty) return false;

            // Skip Description and get Privacy...this requires a custom dialog as
            // virtual keyboard does not allow very much text for longer descriptions.
            // We may create a custom dialog for this in future
            List<GUIListItem> items = new List<GUIListItem>();
            GUIListItem item = new GUIListItem();
            int selectedItem = 0;

            // Public
            item = new GUIListItem { Label = Translation.PrivacyPublic, Label2 = Translation.Public };
            if (list.Privacy == "public") { selectedItem = 0; item.Selected = true; }
            items.Add(item);
            // Private
            item = new GUIListItem { Label = Translation.PrivacyPrivate, Label2 = Translation.Private };
            if (list.Privacy == "private") { selectedItem = 1; item.Selected = true; }
            items.Add(item);
            // Friends
            item = new GUIListItem { Label = Translation.PrivacyFriends, Label2 = Translation.Friends };
            if (list.Privacy == "friends") { selectedItem = 2; item.Selected = true; }
            items.Add(item);

            selectedItem = GUIUtils.ShowMenuDialog(Translation.Privacy, items, selectedItem);
            if (selectedItem == -1) return false;

            list.Privacy = GetPrivacyLevelFromTranslation(items[selectedItem].Label2);
            return true;
        }
开发者ID:edalex86,项目名称:Trakt-for-Mediaportal,代码行数:43,代码来源:TraktLists.cs

示例12: GUIListItem

 /// <summary>
 /// Creates a GUIListItem based on another GUIListItem.
 /// </summary>
 /// <param name="item">The item on which the new item is based.</param>
 public GUIListItem(GUIListItem item)
 {
   _label = item._label;
   _label2 = item._label2;
   _label3 = item._label3;
   _thumbNailName = item._thumbNailName;
   _smallIconName = item._smallIconName;
   _bigIconName = item._bigIconName;
   _pinIconName = item._pinIconName;
   _isSelected = item._isSelected;
   _isFolder = item._isFolder;
   _folder = item._folder;
   _dvdLabel = item._dvdLabel;
   _duration = item._duration;
   _fileInfo = item._fileInfo;
   _rating = item._rating;
   _year = item._year;
   _idItem = item._idItem;
   _tagMusic = item._tagMusic;
   _tagTv = item._tagTv;
   _tagAlbumInfo = item._tagAlbumInfo;
   _isBdDvdFolder = item._isBdDvdFolder;
 }
开发者ID:doskabouter,项目名称:MediaPortal-1,代码行数:27,代码来源:GUIListItem.cs

示例13: item_OnItemSelected

 private void item_OnItemSelected(GUIListItem item, GUIControl parent)
 {
   lock (updateLock)
   {
     if (item != null && item.MusicTag != null)
     {
       //CacheManager.ClearQueryResultsByType(typeof(Program));
       Program lstProg = item.MusicTag as Program;
       if (lstProg != null)
       {
         ScheduleInfo refEpisode = new ScheduleInfo(
           lstProg.IdChannel,
           TVUtil.GetDisplayTitle(lstProg),
           lstProg.Description,
           lstProg.Genre,
           lstProg.StartTime,
           lstProg.EndTime
           );
         GUIGraphicsContext.form.Invoke(new UpdateCurrentItem(UpdateProgramDescription), new object[] {refEpisode});
       }
     }
     else
     {
       Log.Warn("TVProgrammInfo.item_OnItemSelected: params where NULL!");
     }
   }
 }
开发者ID:sanyaade-embedded-systems,项目名称:MediaPortal-1,代码行数:27,代码来源:TVProgramInfo.cs

示例14: CreateProgram

    public static void CreateProgram(Program program, int scheduleType, int dialogId)
    {
      Log.Debug("TVProgramInfo.CreateProgram: program = {0}", program.ToString());
      Schedule schedule;
      Schedule saveSchedule = null;
      TvBusinessLayer layer = new TvBusinessLayer();
      if (IsRecordingProgram(program, out schedule, false)) // check if schedule is already existing
      {
        Log.Debug("TVProgramInfo.CreateProgram - series schedule found ID={0}, Type={1}", schedule.IdSchedule,
                  schedule.ScheduleType);
        Log.Debug("                            - schedule= {0}", schedule.ToString());
        //schedule = Schedule.Retrieve(schedule.IdSchedule); // get the correct informations
        if (schedule.IsSerieIsCanceled(schedule.GetSchedStartTimeForProg(program), program.IdChannel))
        {
          //lets delete the cancelled schedule.

          saveSchedule = schedule;
          schedule = new Schedule(program.IdChannel, program.Title, program.StartTime, program.EndTime);

          schedule.PreRecordInterval = saveSchedule.PreRecordInterval;
          schedule.PostRecordInterval = saveSchedule.PostRecordInterval;
          schedule.ScheduleType = (int)ScheduleRecordingType.Once; // needed for layer.GetConflictingSchedules(...)
        }
      }
      else
      {
        Log.Debug("TVProgramInfo.CreateProgram - no series schedule");
        // no series schedule => create it
        schedule = new Schedule(program.IdChannel, program.Title, program.StartTime, program.EndTime);
        schedule.PreRecordInterval = Int32.Parse(layer.GetSetting("preRecordInterval", "5").Value);
        schedule.PostRecordInterval = Int32.Parse(layer.GetSetting("postRecordInterval", "5").Value);
        schedule.ScheduleType = scheduleType;
      }

      // check if this program is conflicting with any other already scheduled recording
      IList conflicts = layer.GetConflictingSchedules(schedule);
      Log.Debug("TVProgramInfo.CreateProgram - conflicts.Count = {0}", conflicts.Count);
      TvServer server = new TvServer();
      bool skipConflictingEpisodes = false;
      if (conflicts.Count > 0)
      {
        TVConflictDialog dlg =
          (TVConflictDialog)GUIWindowManager.GetWindow((int)Window.WINDOW_DIALOG_TVCONFLICT);
        if (dlg != null)
        {
          dlg.Reset();
          dlg.SetHeading(GUILocalizeStrings.Get(879)); // "recording conflict"
          foreach (Schedule conflict in conflicts)
          {
            Log.Debug("TVProgramInfo.CreateProgram: Conflicts = " + conflict);

            GUIListItem item = new GUIListItem(conflict.ProgramName);
            item.Label2 = GetRecordingDateTime(conflict);
            Channel channel = Channel.Retrieve(conflict.IdChannel);
            if (channel != null && !string.IsNullOrEmpty(channel.DisplayName))
            {
              item.Label3 = channel.DisplayName;
            }
            else
            {
              item.Label3 = conflict.IdChannel.ToString();
            }
            item.TVTag = conflict;
            dlg.AddConflictRecording(item);
          }
          dlg.ConflictingEpisodes = (scheduleType != (int)ScheduleRecordingType.Once);
          dlg.DoModal(dialogId);
          switch (dlg.SelectedLabel)
          {
            case 0: // Skip new Recording
              {
                Log.Debug("TVProgramInfo.CreateProgram: Skip new recording");
                return;
              }
            case 1: // Don't record the already scheduled one(s)
              {
                Log.Debug("TVProgramInfo.CreateProgram: Skip old recording(s)");
                foreach (Schedule conflict in conflicts)
                {
                  Program prog =
                    new Program(conflict.IdChannel, conflict.StartTime, conflict.EndTime, conflict.ProgramName, "-", "-",
                                Program.ProgramState.None,
                                DateTime.MinValue, string.Empty, string.Empty, string.Empty, string.Empty, -1,
                                string.Empty, -1);
                  CancelProgram(prog, Schedule.Retrieve(conflict.IdSchedule), dialogId);
                }
                break;
              }
            case 2: // keep conflict
              {
                Log.Debug("TVProgramInfo.CreateProgram: Keep Conflict");
                break;
              }
            case 3: // Skip for conflicting episodes
              {
                Log.Debug("TVProgramInfo.CreateProgram: Skip conflicting episode(s)");
                skipConflictingEpisodes = true;
                break;
              }
            default: // Skipping new Recording
//.........这里部分代码省略.........
开发者ID:sanyaade-embedded-systems,项目名称:MediaPortal-1,代码行数:101,代码来源:TVProgramInfo.cs

示例15: ShowThumbnailContextMenu

        private void ShowThumbnailContextMenu()
        {
            IDialogbox dlg = (IDialogbox)GUIWindowManager.GetWindow((int)GUIWindow.Window.WINDOW_DIALOG_MENU);
            if (dlg == null) return;

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

            foreach (int value in Enum.GetValues(typeof(Views)))
            {
                Views thumb = (Views)Enum.Parse(typeof(Views), value.ToString());
                string label = GetThumbnailName(thumb);

                // Create new item
                GUIListItem listItem = new GUIListItem(label);
                listItem.ItemId = value;

                // Set selected if current
                if (thumb == ThumbViewMod) listItem.Selected = true;

                // Add new item to context menu
                dlg.Add(listItem);
            }

            dlg.DoModal(GUIWindowManager.ActiveWindow);
            if (dlg.SelectedId <= 0) return;

            // Set new Selection
            ThumbViewMod = (Views)Enum.GetValues(typeof(Views)).GetValue(dlg.SelectedLabel);
            btnThumbViewMod.Label = dlg.SelectedLabelText;
        }
开发者ID:bodiroga,项目名称:Avalon,代码行数:31,代码来源:MovingPicturesConfig.cs


注:本文中的MediaPortal.GUI.Library.GUIListItem类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。