本文整理汇总了C#中ItemsList.FireChange方法的典型用法代码示例。如果您正苦于以下问题:C# ItemsList.FireChange方法的具体用法?C# ItemsList.FireChange怎么用?C# ItemsList.FireChange使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ItemsList
的用法示例。
在下文中一共展示了ItemsList.FireChange方法的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Refresh
private static void Refresh(ItemsList list)
{
RefreshState(list);
list.FireChange();
}
示例2: UpdateSystemsList_NoLock
protected void UpdateSystemsList_NoLock()
{
lock (_syncObj)
{
_systemsList = new ItemsList();
if (_enableLocalShares)
{
ListItem localSystemItem = new ListItem(Consts.KEY_NAME, Consts.RES_SHARES_CONFIG_LOCAL_SHARE);
localSystemItem.AdditionalProperties[Consts.KEY_SHARES_PROXY] = new LocalShares();
localSystemItem.SelectedProperty.Attach(OnSystemSelectionChanged);
_systemsList.Add(localSystemItem);
}
if (_enableServerShares)
{
ListItem serverSystemItem = new ListItem(Consts.KEY_NAME, Consts.RES_SHARES_CONFIG_GLOBAL_SHARE);
serverSystemItem.AdditionalProperties[Consts.KEY_SHARES_PROXY] = new ServerShares();
serverSystemItem.SelectedProperty.Attach(OnSystemSelectionChanged);
_systemsList.Add(serverSystemItem);
}
if (_systemsList.Count > 0)
_systemsList[0].Selected = true;
}
_systemsList.FireChange();
}
示例3: UpdateSharesList_NoLock
protected void UpdateSharesList_NoLock(ItemsList list, List<Share> shareDescriptors, ShareOrigin origin, bool selectFirstItem)
{
list.Clear();
bool selectShare = selectFirstItem;
shareDescriptors.Sort((a, b) => a.Name.CompareTo(b.Name));
foreach (Share share in shareDescriptors)
{
ListItem shareItem = new ListItem(Consts.KEY_NAME, share.Name);
shareItem.AdditionalProperties[Consts.KEY_SHARE] = share;
try
{
string path = origin == ShareOrigin.Local ?
LocalShares.GetLocalResourcePathDisplayName(share.BaseResourcePath) :
ServerShares.GetServerResourcePathDisplayName(share.BaseResourcePath);
if (string.IsNullOrEmpty(path))
// Error case: The path is invalid
path = LocalizationHelper.Translate(Consts.RES_INVALID_PATH, share.BaseResourcePath);
shareItem.SetLabel(Consts.KEY_PATH, path);
Guid? firstResourceProviderId = SharesProxy.GetBaseResourceProviderId(share.BaseResourcePath);
if (firstResourceProviderId.HasValue)
{
ResourceProviderMetadata firstResourceProviderMetadata = origin == ShareOrigin.Local ?
LocalShares.GetLocalResourceProviderMetadata(firstResourceProviderId.Value) :
ServerShares.GetServerResourceProviderMetadata(firstResourceProviderId.Value);
shareItem.AdditionalProperties[Consts.KEY_RESOURCE_PROVIDER_METADATA] = firstResourceProviderMetadata;
}
string categories = StringUtils.Join(", ", share.MediaCategories);
shareItem.SetLabel(Consts.KEY_MEDIA_CATEGORIES, categories);
Share shareCopy = share;
shareItem.Command = new MethodDelegateCommand(() => ShowShareInfo(shareCopy, origin));
}
catch (NotConnectedException)
{
throw;
}
catch (Exception e)
{
ServiceRegistration.Get<ILogger>().Warn("Problems building share item '{0}' (path '{1}')", e, share.Name, share.BaseResourcePath);
}
if (selectShare)
{
selectShare = false;
shareItem.Selected = true;
}
shareItem.SelectedProperty.Attach(OnShareItemSelectionChanged);
lock (_syncObj)
list.Add(shareItem);
}
list.FireChange();
}
示例4: FillChannelGroupList
protected void FillChannelGroupList()
{
if (_channelGroups == null)
return;
_channelGroupList = new ItemsList();
for (int idx = 0; idx < _channelGroups.Count; idx++)
{
IChannelGroup group = _channelGroups[idx];
int selIdx = idx;
ListItem channelGroupItem = new ListItem(UiComponents.Media.General.Consts.KEY_NAME, group.Name)
{
Command = new MethodDelegateCommand(() => SetGroup(selIdx)),
Selected = selIdx == _webChannelGroupIndex
};
_channelGroupList.Add(channelGroupItem);
}
_channelGroupList.FireChange();
}
示例5: UpdatePlaylists
protected void UpdatePlaylists(ItemsList list, List<PlaylistBase> playlistsData, bool selectFirstItem)
{
list.Clear();
bool selectPlaylist = selectFirstItem;
playlistsData.Sort((a, b) => a.Name.CompareTo(b.Name));
foreach (PlaylistBase playlistData in playlistsData)
{
AVType? avType = ConvertPlaylistTypeToAVType(playlistData.PlaylistType);
if (!avType.HasValue)
continue;
ListItem playlistItem = new ListItem(Consts.KEY_NAME, playlistData.Name);
playlistItem.AdditionalProperties[Consts.KEY_PLAYLIST_AV_TYPE] = avType.Value;
playlistItem.AdditionalProperties[Consts.KEY_PLAYLIST_NUM_ITEMS] = playlistData.NumItems;
playlistItem.AdditionalProperties[Consts.KEY_PLAYLIST_DATA] = playlistData;
PlaylistBase plCopy = playlistData;
playlistItem.Command = new MethodDelegateCommand(() => ShowPlaylistInfo(plCopy));
if (selectPlaylist)
{
selectPlaylist = false;
playlistItem.Selected = true;
}
playlistItem.SelectedProperty.Attach(OnPlaylistItemSelectionChanged);
lock (_syncObj)
list.Add(playlistItem);
}
list.FireChange();
}
示例6: RefreshResourceProviderPathList
protected void RefreshResourceProviderPathList(ItemsList items, ResourcePath path)
{
items.Clear();
IEnumerable<ResourcePathMetadata> res = GetChildDirectoriesData(path);
if (res != null)
AddResources(res, items);
if (_enumerateFiles)
{
res = GetFilesData(path);
if (res != null)
AddResources(res, items);
}
items.FireChange();
}
示例7: FillList
protected void FillList(IContentDirectory contentDirectory, Guid[] necessaryMIAs, ItemsList list, MediaItemToListItemAction converterAction)
{
MediaItemQuery query = new MediaItemQuery(necessaryMIAs, null)
{
Limit = (uint)QueryLimit, // Last 5 imported items
SortInformation = new List<SortInformation> { new SortInformation(ImporterAspect.ATTR_DATEADDED, SortDirection.Descending) }
};
var items = contentDirectory.Search(query, false);
list.Clear();
foreach (MediaItem mediaItem in items)
{
PlayableMediaItem listItem = converterAction(mediaItem);
listItem.Command = new MethodDelegateCommand(() => PlayItemsModel.CheckQueryPlayAction(listItem.MediaItem));
list.Add(listItem);
}
list.FireChange();
}
示例8: Filter
public void Filter(ItemsList filterList, ItemsList originalList, string search)
{
// Handle external filter
if (string.IsNullOrEmpty(search))
return;
// Handle given search as single key
KeyPress(search[0]);
// List will not be replaced, as the instance is already bound by screen, we only filter items.
filterList.Clear();
foreach (NavigationItem item in originalList.OfType<NavigationItem>())
{
var simpleTitle = item.SimpleTitle;
// Filter
if (_listFilterAction == FilterAction.StartsWith)
{
if (simpleTitle.ToLower().StartsWith(_listFilterString))
filterList.Add(item);
}
else
{
if (NumPadEncode(simpleTitle).Contains(_listFilterString))
filterList.Add(item);
}
}
filterList.FireChange();
}
示例9: FillChannelGroupList
protected void FillChannelGroupList()
{
_channelGroupList = new ItemsList();
for (int idx = 0; idx < ChannelContext.ChannelGroups.Count; idx++)
{
IChannelGroup group = ChannelContext.ChannelGroups[idx];
ListItem channelGroupItem = new ListItem(UiComponents.Media.General.Consts.KEY_NAME, group.Name)
{
Command = new MethodDelegateCommand(() =>
{
if (ChannelContext.ChannelGroups.MoveTo(g => g == group))
SetGroup();
}),
Selected = group == ChannelContext.ChannelGroups.Current
};
_channelGroupList.Add(channelGroupItem);
}
_channelGroupList.FireChange();
}
示例10: RefreshResourceProviderPathList
protected void RefreshResourceProviderPathList(ItemsList items, ResourcePath path)
{
items.Clear();
IEnumerable<ResourcePathMetadata> res = GetChildDirectoriesData(path);
if (res != null)
{
List<ResourcePathMetadata> directories = new List<ResourcePathMetadata>(res);
directories.Sort((a, b) => a.ResourceName.CompareTo(b.ResourceName));
foreach (ResourcePathMetadata childDirectory in directories)
{
TreeItem directoryItem = new TreeItem(Consts.KEY_NAME, childDirectory.ResourceName);
directoryItem.AdditionalProperties[Consts.KEY_RESOURCE_PATH] = childDirectory.ResourcePath;
directoryItem.SetLabel(Consts.KEY_PATH, childDirectory.HumanReadablePath);
if (ChoosenResourcePath == childDirectory.ResourcePath)
directoryItem.Selected = true;
directoryItem.SelectedProperty.Attach(OnTreePathSelectionChanged);
directoryItem.AdditionalProperties[Consts.KEY_EXPANSION] = new ExpansionHelper(directoryItem, this);
items.Add(directoryItem);
}
}
items.FireChange();
}
示例11: InitList
private void InitList(ItemsList targetList, string selectedEffect, SimpleStringDelegate command)
{
targetList.Clear();
IGeometryManager geometryManager = ServiceRegistration.Get<IGeometryManager>();
string standardEffectFile = geometryManager.StandardEffectFile;
foreach (KeyValuePair<string, string> nameToEffect in geometryManager.AvailableEffects)
{
string file = nameToEffect.Key;
string effectFile = selectedEffect ?? standardEffectFile;
string effectName = nameToEffect.Value;
ListItem item = new ListItem(Consts.KEY_NAME, effectName)
{
Command = new MethodDelegateCommand(() => command(effectName, file)),
Selected = file == effectFile,
};
targetList.Add(item);
}
targetList.FireChange();
}
示例12: UpdateSystemsListForEditShare_NoLock
protected void UpdateSystemsListForEditShare_NoLock()
{
lock (_syncObj)
{
IsResourceProviderSelected = false;
_systemsList = new ItemsList();
if (ShareProxy is LocalShares)
CreateLocalShareRPs(false, true);
if (ShareProxy is ServerShares)
CreateServerShareRPs(false, true);
if (_systemsList.Count > 0)
_systemsList[0].Selected = true;
}
// Call once after list is initialized, this is required for single options only and to avoid locking issues for callback while filling _systemsList.
UpdateProviderSelected();
_systemsList.FireChange();
}