Chronozoom.UI.ChronozoomSVC.GetUserTimelines C# (CSharp) Method

GetUserTimelines() public method

public GetUserTimelines ( string superCollection, string Collection ) : Collection
superCollection string
Collection string
return Collection
        public Collection<TimelineShortcut> GetUserTimelines(string superCollection, string Collection)
        {
            return ApiOperation<Collection<TimelineShortcut>>(delegate(User user, Storage storage)
            {
            #if RELEASE
                if (user == null)
                {
                    return null;
                }
            #endif

                Timeline roottimeline = GetTimelines(superCollection, Collection, null, null, null, null, null, null);

                var elements = new Collection<TimelineShortcut>();

                var timeline = storage.Timelines.Where(x => x.Id == roottimeline.Id)
                           .Include("Collection")
                           .Include("Collection.User")
                           .Include("Exhibits")
                           .Include("Exhibits.ContentItems")
                           .FirstOrDefault();

                if (timeline != null)
                    elements.Add(storage.GetTimelineShortcut(timeline));
                if (roottimeline.ChildTimelines != null)
                {
                    foreach (var t in roottimeline.ChildTimelines)
                    {
                        timeline = storage.Timelines.Where(x => x.Id == t.Id)
                             .Include("Collection")
                             .Include("Collection.User")
                             .Include("Exhibits")
                             .Include("Exhibits.ContentItems")
                             .FirstOrDefault();

                        if (timeline != null)
                            elements.Add(storage.GetTimelineShortcut(timeline));
                    }
                }

                return elements;
            });
        }