Beispiel #1
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 = _defaultScope;
            }

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

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