本文整理汇总了C#中MediaPortal.UI.Presentation.DataObjects.ListItem类的典型用法代码示例。如果您正苦于以下问题:C# ListItem类的具体用法?C# ListItem怎么用?C# ListItem使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ListItem类属于MediaPortal.UI.Presentation.DataObjects命名空间,在下文中一共展示了ListItem类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: UpdateShutdownItems
protected void UpdateShutdownItems()
{
ISettingsManager sm = ServiceRegistration.Get<ISettingsManager>();
List<SystemStateItem> systemStateItems = sm.Load<SystemStateDialogSettings>().ShutdownItemList;
bool timerActive = false;
Models.SleepTimerModel stm = ServiceRegistration.Get<IWorkflowManager>().GetModel(Consts.WF_STATE_ID_SLEEP_TIMER_MODEL) as Models.SleepTimerModel;
if (stm != null && stm.IsSleepTimerActive == true)
{
timerActive = true;
}
_shutdownItems.Clear();
if (systemStateItems != null)
{
for (int i = 0; i < systemStateItems.Count; i++)
{
SystemStateItem systemStateItem = systemStateItems[i];
if (!systemStateItem.Enabled)
continue;
ListItem item = new ListItem(Consts.KEY_NAME, Consts.GetResourceIdentifierForMenuItem(systemStateItem.Action, timerActive));
item.Command = new MethodDelegateCommand(() => DoAction(systemStateItem.Action));
_shutdownItems.Add(item);
}
}
_shutdownItems.FireChange();
}
开发者ID:aspik,项目名称:MediaPortal-2,代码行数:27,代码来源:BaseSystemStateModel.cs
示例2: Select
public void Select(ListItem item)
{
if (item == null)
return;
object actionObj;
object mediaItemObj;
if (!item.AdditionalProperties.TryGetValue(Consts.KEY_MEDIA_ITEM_ACTION, out actionObj) || !item.AdditionalProperties.TryGetValue(Consts.KEY_MEDIA_ITEM, out mediaItemObj))
return;
IMediaItemAction action = actionObj as IMediaItemAction;
MediaItem mediaItem = mediaItemObj as MediaItem;
if (action == null || mediaItem == null)
return;
try
{
ContentDirectoryMessaging.MediaItemChangeType changeType;
if (action.Process(mediaItem, out changeType) && changeType != ContentDirectoryMessaging.MediaItemChangeType.None)
{
ContentDirectoryMessaging.SendMediaItemChangedMessage(mediaItem, changeType);
}
}
catch (Exception ex)
{
ServiceRegistration.Get<ILogger>().Error("Error executing MediaItemAction '{0}':", ex, action.GetType());
}
}
开发者ID:davinx,项目名称:MediaPortal-2,代码行数:27,代码来源:MediaItemsActionModel.cs
示例3: LayoutTypeModel
public LayoutTypeModel()
{
items = new ItemsList();
ListItem listItem = new ListItem(Consts.KEY_NAME, "List")
{
Command = new MethodDelegateCommand(() => UpdateLayout(LayoutType.List))
};
listItem.AdditionalProperties[KEY_LAYOUT_TYPE] = LayoutType.List;
items.Add(listItem);
ListItem gridItem = new ListItem(Consts.KEY_NAME, "Grid")
{
Command = new MethodDelegateCommand(() => UpdateLayout(LayoutType.Icons))
};
gridItem.AdditionalProperties[KEY_LAYOUT_TYPE] = LayoutType.Icons;
items.Add(gridItem);
ListItem coversItem = new ListItem(Consts.KEY_NAME, "Covers")
{
Command = new MethodDelegateCommand(() => UpdateLayout(LayoutType.Cover))
};
coversItem.AdditionalProperties[KEY_LAYOUT_TYPE] = LayoutType.Cover;
items.Add(coversItem);
}
开发者ID:ministerkrister,项目名称:Emulators,代码行数:25,代码来源:LayoutTypeModel.cs
示例4: SettingChanged
protected override void SettingChanged()
{
_items.Clear();
SkinConfigSetting skinSetting = (SkinConfigSetting) _setting;
foreach (SkinManagement.Skin skin in skinSetting.Skins)
{
ListItem skinItem = new ListItem(KEY_NAME, skin.ShortDescription);
skinItem.SetLabel(KEY_TECHNAME, skin.Name);
ISkinResourceBundle resourceBundle;
string preview = skin.GetResourceFilePath(skin.PreviewResourceKey, false, out resourceBundle);
if (preview == null)
{
Theme defaultTheme = skin.DefaultTheme;
if (defaultTheme != null)
preview = defaultTheme.GetResourceFilePath(skin.PreviewResourceKey, false, out resourceBundle);
}
skinItem.SetLabel(KEY_IMAGESRC, preview);
_items.Add(skinItem);
if (skinSetting.CurrentSkinName == skin.Name)
{
skinItem.Selected = true;
_choosenItem = skinItem;
}
}
_items.FireChange();
base.SettingChanged();
}
开发者ID:chekiI,项目名称:MediaPortal-2,代码行数:27,代码来源:SkinConfigurationController.cs
示例5: RefreshUserList
/// <summary>
/// this will turn the _users list into the _usersExposed list
/// </summary>
private void RefreshUserList()
{
IList<IUser> users = ServiceRegistration.Get<IUserService>().GetUsers();
// clear the exposed users list
Users.Clear();
// add users to expose them
foreach (IUser user in users)
{
if (user == null)
{
continue;
}
ListItem buff = new ListItem();
buff.SetLabel("UserName", user.UserName);
buff.SetLabel("UserImage", user.UserImage);
if (user.NeedsPassword)
{
buff.SetLabel("NeedsPassword", "true");
}
else
{
buff.SetLabel("NeedsPassword", "false");
}
buff.SetLabel("LastLogin", user.LastLogin.ToString("G"));
Users.Add(buff);
}
// tell the skin that something might have changed
Users.FireChange();
}
开发者ID:davinx,项目名称:MediaPortal-2,代码行数:32,代码来源:LoginModel.cs
示例6: ItemCheckedChanged
private bool ItemCheckedChanged(int index, ListItem item)
{
bool isChecked = (bool) item.AdditionalProperties[Consts.KEY_IS_CHECKED];
_shutdownItemList[index].Enabled = isChecked;
return true;
}
开发者ID:jgauffin,项目名称:MediaPortal-2,代码行数:8,代码来源:SystemStateConfigurationModel.cs
示例7: SelectMovie
public static void SelectMovie(ListItem item)
{
var t = new Trailer { Title = (string)item.AdditionalProperties[NAME], Url = (string)item.AdditionalProperties[TRAILER] };
if (t.Url != "")
{
CinemaPlayerHelper.PlayStream(t);
}
}
开发者ID:BigGranu,项目名称:Cinema_MP2,代码行数:8,代码来源:CinemaComingSoonBluRay.cs
示例8:
bool IFanartImageSourceProvider.TryCreateFanartImageSource(ListItem listItem, out FanArtImageSource fanartImageSource)
{
SeriesFilterItem series = listItem as SeriesFilterItem;
if (series != null)
{
fanartImageSource = new FanArtImageSource
{
FanArtMediaType = FanArtMediaTypes.Series,
FanArtName = series.SimpleTitle
};
return true;
}
SeriesItem episode = listItem as SeriesItem;
if (episode != null)
{
fanartImageSource = new FanArtImageSource
{
FanArtMediaType = FanArtMediaTypes.Series,
FanArtName = episode.Series
};
return true;
}
MovieFilterItem movieCollection = listItem as MovieFilterItem;
if (movieCollection != null)
{
fanartImageSource = new FanArtImageSource
{
FanArtMediaType = FanArtMediaTypes.MovieCollection,
FanArtName = movieCollection.SimpleTitle
};
return true;
}
MovieItem movie = listItem as MovieItem;
if (movie != null)
{
fanartImageSource = new FanArtImageSource
{
FanArtMediaType = FanArtMediaTypes.Movie,
// Fanart loading now depends on the MediaItemId to support local fanart
FanArtName = movie.MediaItem.MediaItemId.ToString()
};
return true;
}
VideoItem video = listItem as VideoItem;
if (video != null)
{
fanartImageSource = new FanArtImageSource
{
FanArtMediaType = FanArtMediaTypes.Movie,
// Fanart loading now depends on the MediaItemId to support local fanart
FanArtName = video.MediaItem.MediaItemId.ToString()
};
return true;
}
fanartImageSource = null;
return false;
}
开发者ID:aspik,项目名称:MediaPortal-2,代码行数:57,代码来源:FanartImageSourceProvider.cs
示例9: MoveItemUp
private bool MoveItemUp(int index, ListItem item)
{
if (index <= 0 || index >= _shutdownItems.Count)
return false;
Utilities.CollectionUtils.Swap(_shutdownItemList, index, index - 1);
_focusedDownButton = -1;
_focusedUpButton = index - 1;
UpdateShutdownItems();
return true;
}
开发者ID:jgauffin,项目名称:MediaPortal-2,代码行数:12,代码来源:SystemStateConfigurationModel.cs
示例10: MoveItemDown
protected virtual bool MoveItemDown(int index, ListItem item)
{
IPlaylist playlist = _playlist;
if (playlist == null)
return false;
lock (playlist.SyncObj)
{
if (index < 0 || index >= playlist.ItemList.Count - 1)
return false;
playlist.Swap(index, index + 1);
return true;
}
}
开发者ID:HAF-Blade,项目名称:MediaPortal-2,代码行数:13,代码来源:BasePlaylistModel.cs
示例11: PlatformSelectModel
public PlatformSelectModel()
{
items = new ItemsList();
var platforms = Dropdowns.GetPlatformList();
for (int i = -1; i < platforms.Count; i++)
{
string platformName = i < 0 ? "" : platforms[i].Name;
ListItem item = new ListItem(Consts.KEY_NAME, platformName)
{
Command = new MethodDelegateCommand(() => UpdatePlatform(platformName))
};
item.AdditionalProperties[KEY_PLATFORM] = platformName;
items.Add(item);
}
}
开发者ID:ministerkrister,项目名称:Emulators,代码行数:15,代码来源:PlatformSelectModel.cs
示例12: Init
public static void Init()
{
items.Clear();
var oneItemSelected = false;
foreach (var cd in GoogleMovies.GoogleMovies.Data.List)
{
var item = new ListItem();
item.AdditionalProperties[NAME] = cd.Current.Id;
item.SetLabel("Name", cd.Current.Name + " - " + cd.Current.Address);
items.Add(item);
if (oneItemSelected) continue;
CinemaHome.SelectCinema(cd.Current.Id);
oneItemSelected = true;
}
items.FireChange();
}
开发者ID:BigGranu,项目名称:Cinema_MP2,代码行数:17,代码来源:DlgSelectCinema.cs
示例13: ViewModeModel
public ViewModeModel()
{
ViewSettings settings = ServiceRegistration.Get<ISettingsManager>().Load<ViewSettings>();
_layoutTypeProperty = new WProperty(typeof(LayoutType), settings.LayoutType);
_layoutSizeProperty = new WProperty(typeof(LayoutSize), settings.LayoutSize);
ListItem smallList = new ListItem(Consts.KEY_NAME, Consts.RES_SMALL_LIST)
{
Command = new MethodDelegateCommand(() => SetViewMode(LayoutType.ListLayout, LayoutSize.Small)),
};
smallList.AdditionalProperties[Consts.KEY_LAYOUT_TYPE] = LayoutType.ListLayout;
smallList.AdditionalProperties[Consts.KEY_LAYOUT_SIZE] = LayoutSize.Small;
_viewModeItemsList.Add(smallList);
ListItem mediumlList = new ListItem(Consts.KEY_NAME, Consts.RES_MEDIUM_LIST)
{
Command = new MethodDelegateCommand(() => SetViewMode(LayoutType.ListLayout, LayoutSize.Medium))
};
mediumlList.AdditionalProperties[Consts.KEY_LAYOUT_TYPE] = LayoutType.ListLayout;
mediumlList.AdditionalProperties[Consts.KEY_LAYOUT_SIZE] = LayoutSize.Medium;
_viewModeItemsList.Add(mediumlList);
ListItem largeList = new ListItem(Consts.KEY_NAME, Consts.RES_LARGE_LIST)
{
Command = new MethodDelegateCommand(() => SetViewMode(LayoutType.ListLayout, LayoutSize.Large))
};
largeList.AdditionalProperties[Consts.KEY_LAYOUT_TYPE] = LayoutType.ListLayout;
largeList.AdditionalProperties[Consts.KEY_LAYOUT_SIZE] = LayoutSize.Large;
_viewModeItemsList.Add(largeList);
ListItem largeGrid = new ListItem(Consts.KEY_NAME, Consts.RES_LARGE_GRID)
{
Command = new MethodDelegateCommand(() => SetViewMode(LayoutType.GridLayout, LayoutSize.Large))
};
largeGrid.AdditionalProperties[Consts.KEY_LAYOUT_TYPE] = LayoutType.GridLayout;
largeGrid.AdditionalProperties[Consts.KEY_LAYOUT_SIZE] = LayoutSize.Large;
_viewModeItemsList.Add(largeGrid);
ListItem coverLarge = new ListItem(Consts.KEY_NAME, Consts.RES_LARGE_COVER)
{
Command = new MethodDelegateCommand(() => SetViewMode(LayoutType.CoverLayout, LayoutSize.Large))
};
coverLarge.AdditionalProperties[Consts.KEY_LAYOUT_TYPE] = LayoutType.CoverLayout;
coverLarge.AdditionalProperties[Consts.KEY_LAYOUT_SIZE] = LayoutSize.Large;
_viewModeItemsList.Add(coverLarge);
}
开发者ID:HAF-Blade,项目名称:MediaPortal-2,代码行数:46,代码来源:ViewModeModel.cs
示例14: TryGetAction
private bool TryGetAction(ListItem item, out SystemStateAction action)
{
action = SystemStateAction.Suspend;
if (item == null)
return false;
object oIndex;
if (item.AdditionalProperties.TryGetValue(Consts.KEY_INDEX, out oIndex))
{
int? i = oIndex as int?;
if (i.HasValue)
{
action = ShutdownItemList[i.Value].Action;
return true;
}
}
return false;
}
开发者ID:jgauffin,项目名称:MediaPortal-2,代码行数:18,代码来源:SystemStateModel.cs
示例15: ViewModeModel
public ViewModeModel()
{
startupItems = new ItemsList();
var startupStates = StartupStateSetting.StartupStates;
foreach (string key in startupStates.Keys)
{
StartupState state = startupStates[key];
if (state != StartupState.LASTUSED)
{
ListItem item = new ListItem(Consts.KEY_NAME, LocalizationHelper.CreateResourceString(key))
{
Command = new MethodDelegateCommand(() => SetStartupState(state))
};
item.AdditionalProperties[KEY_STARTUP_STATE] = state;
startupItems.Add(item);
}
}
}
开发者ID:ministerkrister,项目名称:Emulators,代码行数:18,代码来源:ViewModeModel.cs
示例16: UpdateSortingsList
protected void UpdateSortingsList()
{
_sortingItemsList.Clear();
NavigationData navigationData = GetCurrentNavigationData();
ICollection<Sorting.Sorting> sortings = navigationData.AvailableSortings;
if (sortings == null)
return;
foreach (Sorting.Sorting sorting in sortings)
{
Sorting.Sorting sortingCopy = sorting;
ListItem sortingItem = new ListItem(Consts.KEY_NAME, sorting.DisplayName)
{
Command = new MethodDelegateCommand(() => navigationData.CurrentSorting = sortingCopy)
};
sortingItem.AdditionalProperties[Consts.KEY_SORTING] = sortingCopy;
_sortingItemsList.Add(sortingItem);
}
_sortingItemsList.FireChange();
}
开发者ID:joconno4,项目名称:MediaPortal-2,代码行数:19,代码来源:MediaSortingModel.cs
示例17: UpdateFiltersList
protected void UpdateFiltersList()
{
_filterItemsList.Clear();
NavigationData navigationData = GetCurrentNavigationData();
IList<WorkflowAction> actions = navigationData.GetWorkflowActions();
if (actions == null)
return;
foreach (WorkflowAction action in actions)
{
WorkflowAction actionCopy = action;
ListItem screenItem = new ListItem(Consts.KEY_NAME, action.DisplayTitle)
{
Command = new MethodDelegateCommand(actionCopy.Execute)
};
screenItem.AdditionalProperties[Consts.KEY_FILTER] = actionCopy;
_filterItemsList.Add(screenItem);
}
_filterItemsList.FireChange();
}
开发者ID:chekiI,项目名称:MediaPortal-2,代码行数:19,代码来源:MediaFilterModel.cs
示例18: SettingChanged
protected override void SettingChanged()
{
_items.Clear();
ThemeConfigSetting themeSetting = (ThemeConfigSetting) _setting;
foreach (Theme theme in themeSetting.Themes)
{
ListItem themeItem = new ListItem(KEY_NAME, theme.ShortDescription);
themeItem.SetLabel(KEY_TECHNAME, theme.Name);
ISkinResourceBundle resourceBundle;
string preview = theme.GetResourceFilePath(theme.PreviewResourceKey, false, out resourceBundle);
themeItem.SetLabel(KEY_IMAGESRC, preview);
_items.Add(themeItem);
if (themeSetting.CurrentThemeName == theme.Name)
{
themeItem.Selected = true;
_choosenItem = themeItem;
}
}
_items.FireChange();
base.SettingChanged();
}
开发者ID:joconno4,项目名称:MediaPortal-2,代码行数:21,代码来源:ThemeConfigurationController.cs
示例19: CreatePossibleValuesList
ItemsList CreatePossibleValuesList()
{
var result = new ItemsList();
if (PropertyDescriptor.IsBool)
{
var item = new ListItem(Consts.KEY_NAME, new StringId("[System.Yes]")) { Selected = Value == true.ToString() };
item.AdditionalProperties.Add(KEY_VALUE, true.ToString());
result.Add(item);
item = new ListItem(Consts.KEY_NAME, new StringId("[System.No]")) { Selected = Value == false.ToString() };
item.AdditionalProperties.Add(KEY_VALUE, false.ToString());
result.Add(item);
}
else if (PropertyDescriptor.IsEnum)
{
foreach (string e in PropertyDescriptor.GetEnumValues())
{
var item = new ListItem(Consts.KEY_NAME, e) { Selected = Value == e };
item.AdditionalProperties.Add(KEY_VALUE, e);
result.Add(item);
}
}
return result;
}
开发者ID:offbyoneBB,项目名称:mp-onlinevideos2,代码行数:24,代码来源:SiteSettingViewModel.cs
示例20: ShowLoadSkinDialog
public static void ShowLoadSkinDialog()
{
IScreenManager screenManager = ServiceRegistration.Get<IScreenManager>();
SkinManager skinManager = ServiceRegistration.Get<ISkinResourceManager>() as SkinManager;
if (skinManager == null)
return;
ItemsList skinItems = new ItemsList();
foreach (Skin skin in skinManager.Skins.Values)
{
if (!skin.IsValid)
continue;
string skinName = skin.Name;
ListItem skinItem = new ListItem(Consts.KEY_NAME, skinName)
{
Command = new MethodDelegateCommand(() => screenManager.SwitchSkinAndTheme(skinName, null))
};
skinItems.Add(skinItem);
}
ShowDialog(Consts.RES_LOAD_SKIN_TITLE, skinItems);
}
开发者ID:joconno4,项目名称:MediaPortal-2,代码行数:20,代码来源:LoadSkinThemeModel.cs
注:本文中的MediaPortal.UI.Presentation.DataObjects.ListItem类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论