Ejemplo n.º 1
0
        public ReadOnlyCollection <BookmarkInfo> GetBookmarks(BookmarkScope scope)
        {
            Fx.Assert(scope != null, "We should never be passed null here.");

            BookmarkManager manager     = null;
            BookmarkScope   lookupScope = scope;

            if (scope.IsDefault)
            {
                lookupScope = this.defaultScope;
            }

            if (this.bookmarkManagers.TryGetValue(lookupScope, out manager))
            {
                if (!manager.HasBookmarks)
                {
                    manager = null;
                }
            }


            if (manager != null)
            {
                List <BookmarkInfo> bookmarks = new List <BookmarkInfo>();

                manager.PopulateBookmarkInfo(bookmarks);

                return(new ReadOnlyCollection <BookmarkInfo>(bookmarks));
            }
            else
            {
                return(null);
            }
        }
Ejemplo n.º 2
0
        public ReadOnlyCollection <BookmarkInfo> GetBookmarks(BookmarkScope scope)
        {
            BookmarkManager manager = null;
            BookmarkScope   key     = scope;

            if (scope.IsDefault)
            {
                key = this.defaultScope;
            }
            if (this.bookmarkManagers.TryGetValue(key, out manager) && !manager.HasBookmarks)
            {
                manager = null;
            }
            if (manager != null)
            {
                List <BookmarkInfo> bookmarks = new List <BookmarkInfo>();
                manager.PopulateBookmarkInfo(bookmarks);
                return(new ReadOnlyCollection <BookmarkInfo>(bookmarks));
            }
            return(null);
        }