本文整理汇总了C#中MediaPortal.GUI.Library.GUIListItem类的典型用法代码示例。如果您正苦于以下问题:C# GUIListItem类的具体用法?C# GUIListItem怎么用?C# GUIListItem使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
GUIListItem类属于MediaPortal.GUI.Library命名空间,在下文中一共展示了GUIListItem类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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
示例16: workerRefreshUnlinkedFiles_DoWork
void workerRefreshUnlinkedFiles_DoWork(object sender, DoWorkEventArgs e)
{
List<VideoLocalVM> unlinkedVideos = JMMServerHelper.GetUnlinkedVideos();
List<GUIListItem> listItems = new List<GUIListItem>();
foreach (VideoLocalVM locFile in unlinkedVideos)
{
GUIListItem itm = new GUIListItem(locFile.FileName);
itm.TVTag = locFile;
listItems.Add(itm);
}
e.Result = listItems;
}
开发者ID:japanesemediamanager,项目名称:animeplugin3,代码行数:15,代码来源:AdminWindow.cs
示例17: RenderItem
/// <summary>
/// Method to render a single item of the filmstrip
/// </summary>
/// <param name="bFocus">true if item shown be drawn focused, false for normal mode</param>
/// <param name="dwPosX">x-coordinate of the item</param>
/// <param name="dwPosY">y-coordinate of the item</param>
/// <param name="pItem">item itself</param>
private void RenderItem(int itemNumber, float timePassed, bool bFocus, int dwPosX, int dwPosY, GUIListItem pItem)
{
if (_font == null)
{
return;
}
if (pItem == null)
{
return;
}
if (dwPosY < 0)
{
return;
}
bool itemFocused = bFocus == true && Focus && _listType == GUIListControl.ListType.CONTROL_LIST;
float fTextHeight = 0, fTextWidth = 0;
_font.GetTextExtent("W", ref fTextWidth, ref fTextHeight);
float fTextPosY = (float)dwPosY + (float)_textureHeight;
TransformMatrix tm = null;
long dwColor = _textColor;
if (pItem.Selected)
{
dwColor = _selectedColor;
}
if (pItem.IsPlayed)
{
dwColor = _playedColor;
}
if (!bFocus && Focus)
{
dwColor = Color.FromArgb(_unfocusedAlpha, Color.FromArgb((int)dwColor)).ToArgb();
}
if (pItem.IsRemote)
{
dwColor = _remoteColor;
if (pItem.IsDownloading)
{
dwColor = _downloadColor;
}
}
if (pItem.IsBdDvdFolder)
{
dwColor = _bdDvdDirectoryColor;
}
if (!Focus)
{
dwColor &= DimColor;
}
//uint currentTime = (uint) (DXUtil.Timer(DirectXTimer.GetAbsoluteTime)*1000.0);
uint currentTime = (uint)System.Windows.Media.Animation.AnimationTimer.TickCount;
// Set oversized value
int iOverSized = 0;
if (itemFocused && _enableFocusZoom)
{
iOverSized = (_thumbNailWidth + _thumbNailHeight) / THUMBNAIL_OVERSIZED_DIVIDER;
}
GUIImage pImage = null;
if (pItem.HasThumbnail)
{
pImage = pItem.Thumbnail;
if (null == pImage && _sleeper == 0 && !IsAnimating)
{
pImage = new GUIImage(0, 0, _thumbNailPositionX - iOverSized + dwPosX,
_thumbNailPositionY - iOverSized + dwPosY, _thumbNailWidth + 2 * iOverSized,
_thumbNailHeight + 2 * iOverSized, pItem.ThumbnailImage, 0x0);
pImage.ParentControl = this;
pImage.KeepAspectRatio = _keepAspectRatio;
pImage.ZoomFromTop = !pItem.IsFolder && _zoom;
pImage.ImageAlignment = _imageAlignment;
pImage.ImageVAlignment = _imageVAlignment;
pImage.FlipX = _flipX;
pImage.FlipY = _flipY;
pImage.DiffuseFileName = _diffuseFileName;
pImage.MaskFileName = _textureMask;
pImage.SetAnimations(_allThumbAnimations);
pImage.AllocResources();
pItem.Thumbnail = pImage;
pImage.SetPosition(_thumbNailPositionX - iOverSized + dwPosX, _thumbNailPositionY - iOverSized + dwPosY);
pImage.DimColor = DimColor;
_sleeper += SLEEP_FRAME_COUNT;
}
if (null != pImage)
{
if (pImage.TextureHeight == 0 && pImage.TextureWidth == 0)
{
//.........这里部分代码省略.........
开发者ID:MediaPortal,项目名称:MediaPortal-1,代码行数:101,代码来源:GUIFilmstripControl.cs
示例18: Insert
public void Insert(int index, GUIListItem item)
{
if (item == null)
{
return;
}
_listItems.Insert(index, item);
int iItemsPerPage = _columns;
int iPages = iItemsPerPage == 0 ? 0 : _listItems.Count / iItemsPerPage;
if (iItemsPerPage != 0)
{
if ((_listItems.Count % iItemsPerPage) != 0)
{
iPages++;
}
}
if (_upDownControl != null)
{
_upDownControl.SetRange(1, iPages);
_upDownControl.Value = 1;
}
_refresh = true;
}
开发者ID:MediaPortal,项目名称:MediaPortal-1,代码行数:23,代码来源:GUIFilmstripControl.cs
示例19: Replace
public void Replace(int index, GUIListItem item)
{
if (item != null && index >= 0 && index < _listItems.Count)
{
_listItems[index] = item;
}
}
开发者ID:MediaPortal,项目名称:MediaPortal-1,代码行数:7,代码来源:GUIFilmstripControl.cs
示例20: OnActiveStreams
private void OnActiveStreams()
{
GUIDialogMenu dlg = (GUIDialogMenu)GUIWindowManager.GetWindow((int)Window.WINDOW_DIALOG_MENU);
if (dlg == null)
{
return;
}
dlg.Reset();
dlg.SetHeading(692); // Active Tv Streams
int selected = 0;
IList<Card> cards = TvDatabase.Card.ListAll();
List<Channel> channels = new List<Channel>();
int count = 0;
TvServer server = new TvServer();
List<IUser> _users = new List<IUser>();
foreach (Card card in cards)
{
if (card.Enabled == false)
{
continue;
}
if (!RemoteControl.Instance.CardPresent(card.IdCard))
{
continue;
}
IUser[] users = RemoteControl.Instance.GetUsersForCard(card.IdCard);
if (users == null)
{
return;
}
for (int i = 0; i < users.Length; ++i)
{
IUser user = users[i];
if (card.IdCard != user.CardId)
{
continue;
}
bool isRecording;
bool isTimeShifting;
VirtualCard tvcard = new VirtualCard(user, RemoteControl.HostName);
isRecording = tvcard.IsRecording;
isTimeShifting = tvcard.IsTimeShifting;
if (isTimeShifting || (isRecording && !isTimeShifting))
{
int idChannel = tvcard.IdChannel;
user = tvcard.User;
Channel ch = Channel.Retrieve(idChannel);
channels.Add(ch);
GUIListItem item = new GUIListItem();
item.Label = ch.DisplayName;
item.Label2 = user.Name;
string strLogo = Utils.GetCoverArt(Thumbs.TVChannel, ch.DisplayName);
if (string.IsNullOrEmpty(strLogo))
{
strLogo = "defaultVideoBig.png";
}
item.IconImage = strLogo;
if (isRecording)
{
item.PinImage = Thumbs.TvRecordingIcon;
}
else
{
item.PinImage = "";
}
dlg.Add(item);
_users.Add(user);
if (Card != null && Card.IdChannel == idChannel)
{
selected = count;
}
count++;
}
}
}
if (channels.Count == 0)
{
GUIDialogOK pDlgOK = (GUIDialogOK)GUIWindowManager.GetWindow((int)Window.WINDOW_DIALOG_OK);
if (pDlgOK != null)
{
pDlgOK.SetHeading(692); //my tv
pDlgOK.SetLine(1, GUILocalizeStrings.Get(1511)); // No Active streams
pDlgOK.SetLine(2, "");
pDlgOK.DoModal(this.GetID);
}
return;
}
dlg.SelectedLabel = selected;
dlg.DoModal(this.GetID);
if (dlg.SelectedLabel < 0)
{
return;
}
VirtualCard vCard = new VirtualCard(_users[dlg.SelectedLabel], RemoteControl.HostName);
Channel channel = Navigator.GetChannel(vCard.IdChannel);
ViewChannel(channel);
}
开发者ID:splatterpop,项目名称:MediaPortal-1,代码行数:99,代码来源:TVHome.cs
注:本文中的MediaPortal.GUI.Library.GUIListItem类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论