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


C# ItemsList.FireChange方法代码示例

本文整理汇总了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();
 }
开发者ID:BigGranu,项目名称:Webradio_MP2,代码行数:5,代码来源:WebradioFilter.cs

示例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();
    }
开发者ID:jgauffin,项目名称:MediaPortal-2,代码行数:27,代码来源:SharesConfigModel.cs

示例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();
 }
开发者ID:jgauffin,项目名称:MediaPortal-2,代码行数:50,代码来源:SharesConfigModel.cs

示例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();
    }
开发者ID:BigGranu,项目名称:MediaPortal-2,代码行数:19,代码来源:SlimTvModelBase.cs

示例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();
 }
开发者ID:VicDemented,项目名称:MediaPortal-2,代码行数:27,代码来源:ManagePlaylistsModel.cs

示例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();
 }
开发者ID:joconno4,项目名称:MediaPortal-2,代码行数:14,代码来源:PathBrowserService.cs

示例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();
    }
开发者ID:davinx,项目名称:MediaPortal-2,代码行数:18,代码来源:LatestMediaModel.cs

示例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();
    }
开发者ID:aspik,项目名称:MediaPortal-2,代码行数:29,代码来源:RemoteNumpadFilter.cs

示例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();
 }
开发者ID:pacificIT,项目名称:MediaPortal-2,代码行数:19,代码来源:SlimTvModelBase.cs

示例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();
 }
开发者ID:chekiI,项目名称:MediaPortal-2,代码行数:22,代码来源:ShareProxy.cs

示例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();
 }
开发者ID:davinx,项目名称:MediaPortal-2,代码行数:19,代码来源:VideoEffectSetupModel.cs

示例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();
    }
开发者ID:chekiI,项目名称:MediaPortal-2,代码行数:20,代码来源:SharesConfigModel.cs


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