コード例 #1
0
 private void FeedManager_FeedSourceRemoved(object sender, FeedSourceRemovedEventArgs e)
 {
     if (e.Feed.Id == FeedGroup?.Id)
     {
         var item = FeedSources.FirstOrDefault(x => x.Bookmark.Id == e.Bookmark.Id);
         FeedSources.Remove(item);
     }
 }
コード例 #2
0
 IEnumerable <IPackage> IPackageFeed.FindPackages(IReadOnlyList <string> names, string version)
 {
     foreach (var feed in FeedSources
              .Select(GetSource)
              .ToArray())
     {
         foreach (var package in feed
                  .FindPackages(names, version))
         {
             yield return(package);
         }
     }
 }
コード例 #3
0
        public override void OnNavigatedTo(NavigatedToEventArgs e, Dictionary <string, object> viewModelState)
        {
            base.OnNavigatedTo(e, viewModelState);

            FeedGroup = null;

            if (e.Parameter is int)
            {
                var feedGroupId = (int)e.Parameter;

                FeedGroup = HohoemaApp.FeedManager.GetFeedGroup(feedGroupId);
            }
            else if (e.Parameter is string)
            {
                if (int.TryParse(e.Parameter as string, out int feedGroupId))
                {
                    FeedGroup = HohoemaApp.FeedManager.GetFeedGroup(feedGroupId);
                }
            }

            IsDeleted.Value = FeedGroup == null;

            if (FeedGroup != null)
            {
                FeedGroupName.Value = FeedGroup.Label;

                FeedSources.Clear();
                foreach (var mylistFeedSrouce in FeedGroup.Sources)
                {
                    FeedSources.Add(new FeedSourceBookmark()
                    {
                        Feed = FeedGroup, Bookmark = mylistFeedSrouce
                    });
                }

                HohoemaApp.FeedManager.FeedSourceRemoved += FeedManager_FeedSourceRemoved;
            }
        }