예제 #1
0
        public static PodcastGroup FromData(IServiceContext serviceContext, PodcastGroupData data)
        {
            PodcastGroup group = new PodcastGroup(serviceContext)
            {
                Id = data.Id
            };

            group.Podcasts = new ConcurrentObservableCollection <Podcast>(null, true);
            foreach (RoamingPodcastData podcastData in data.RoamingPodcastsData)
            {
                group.Podcasts.Add(Podcast.FromRoamingData(serviceContext, podcastData));
            }
            group.Podcasts.HoldNotifications = false;
            return(group);
        }
예제 #2
0
        public PodcastGroupData ToData()
        {
            PodcastGroupData data = new PodcastGroupData()
            {
                Id = Id
            };
            List <RoamingPodcastData> podcasts = new List <RoamingPodcastData>();

            data.RoamingPodcastsData = podcasts;

            foreach (Podcast podcast in Podcasts)
            {
                podcasts.Add(podcast.ToRoamingData());
            }
            return(data);
        }