Пример #1
0
        public Bookmark CreateBookmark(string name, BookmarkScope scope, BookmarkCallback callback, System.Activities.ActivityInstance owningInstance, BookmarkOptions options)
        {
            BookmarkManager manager = null;
            BookmarkScope   key     = scope;

            if (scope.IsDefault)
            {
                key = this.defaultScope;
            }
            if (!this.bookmarkManagers.TryGetValue(key, out manager))
            {
                throw FxTrace.Exception.AsError(new InvalidOperationException(System.Activities.SR.RegisteredBookmarkScopeRequired));
            }
            return(manager.CreateBookmark(name, callback, owningInstance, options));
        }
Пример #2
0
        public Bookmark CreateBookmark(string name, BookmarkScope scope, BookmarkCallback callback, ActivityInstance owningInstance, BookmarkOptions options)
        {
            Fx.Assert(scope != null, "We should never have a null scope.");

            BookmarkManager manager     = null;
            BookmarkScope   lookupScope = scope;

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

            if (!this.bookmarkManagers.TryGetValue(lookupScope, out manager))
            {
                throw FxTrace.Exception.AsError(new InvalidOperationException(SR.RegisteredBookmarkScopeRequired));
            }

            return(manager.CreateBookmark(name, callback, owningInstance, options));
        }