public static void Validate(BookmarkOptions options, string argumentName)
 {
     if (!IsDefined(options))
     {
         throw FxTrace.Exception.AsError(new InvalidEnumArgumentException(argumentName, (int) options, typeof(BookmarkOptions)));
     }
 }
コード例 #2
0
        public BookmarkCallbackWrapper(BookmarkCallback callback, ActivityInstance owningInstance, BookmarkOptions bookmarkOptions)
            : base(callback, owningInstance)
        {
            Fx.Assert(callback != null || bookmarkOptions == BookmarkOptions.None, "Either we have a callback or we only allow SingleFire, Blocking bookmarks.");

            this.Options = bookmarkOptions;
        }
 public Bookmark CreateBookmark(BookmarkCallback callback, System.Activities.ActivityInstance owningInstance, BookmarkOptions options)
 {
     Bookmark bookmark = Bookmark.Create(this.GetNextBookmarkId());
     this.AddBookmark(bookmark, callback, owningInstance, options);
     this.UpdateAllExclusiveHandles(bookmark, owningInstance);
     return bookmark;
 }
 private static bool IsDefined(BookmarkOptions options)
 {
     if (options != BookmarkOptions.None)
     {
         return ((options & (BookmarkOptions.NonBlocking | BookmarkOptions.MultipleResume)) == options);
     }
     return true;
 }
 public Bookmark CreateBookmark(string name, BookmarkCallback callback, System.Activities.ActivityInstance owningInstance, BookmarkOptions options)
 {
     Bookmark key = new Bookmark(name);
     if ((this.bookmarks != null) && this.bookmarks.ContainsKey(key))
     {
         throw FxTrace.Exception.AsError(new InvalidOperationException(System.Activities.SR.BookmarkAlreadyExists(name)));
     }
     this.AddBookmark(key, callback, owningInstance, options);
     this.UpdateAllExclusiveHandles(key, owningInstance);
     return key;
 }
コード例 #6
0
        internal void AddBookmark(Bookmark bookmark, BookmarkOptions options)
        {
            bool affectsBusyCount = false;

            if (!BookmarkOptionsHelper.IsNonBlocking(options))
            {
                this.IncrementBusyCount();
                affectsBusyCount = true;
            }
            this.EnsureExtendedData();
            this.extendedData.AddBookmark(bookmark, affectsBusyCount);
        }
コード例 #7
0
        public Bookmark CreateBookmark(string name, BookmarkCallback callback, ActivityInstance owningInstance, BookmarkOptions options)
        {
            Bookmark toAdd = new Bookmark(name);

            if (this.bookmarks != null && this.bookmarks.ContainsKey(toAdd))
            {
                throw FxTrace.Exception.AsError(new InvalidOperationException(SR.BookmarkAlreadyExists(name)));
            }

            AddBookmark(toAdd, callback, owningInstance, options);
            //Regular bookmarks are never important
            UpdateAllExclusiveHandles(toAdd, owningInstance);

            return toAdd;
        }
 private void AddBookmark(Bookmark bookmark, BookmarkCallback callback, System.Activities.ActivityInstance owningInstance, BookmarkOptions options)
 {
     if (this.bookmarks == null)
     {
         this.bookmarks = new Dictionary<Bookmark, BookmarkCallbackWrapper>(Bookmark.Comparer);
     }
     bookmark.Scope = this.scope;
     BookmarkCallbackWrapper wrapper = new BookmarkCallbackWrapper(callback, owningInstance, options) {
         Bookmark = bookmark
     };
     this.bookmarks.Add(bookmark, wrapper);
     owningInstance.AddBookmark(bookmark, options);
     if (TD.CreateBookmarkIsEnabled())
     {
         TD.CreateBookmark(owningInstance.Activity.GetType().ToString(), owningInstance.Activity.DisplayName, owningInstance.Id, ActivityUtilities.GetTraceString(bookmark), ActivityUtilities.GetTraceString(bookmark.Scope));
     }
 }
        private void Form1_Load(object sender, EventArgs e)
        {
            richEditControl1.LoadDocument("Hyperlinks.docx");
            InsertHyperlink();
            InsertBookmark();

            #region #HyperlinkOptions
            hyperlinkOptions = richEditControl1.Options.Hyperlinks;

            hyperlinkOptions.EnableUriCorrection = false;
            hyperlinkOptions.ModifierKeys        = PortableKeys.Shift;
            hyperlinkOptions.ShowToolTip         = true;
            #endregion #Hyperlinkoptions

            #region #BookmarkOptions
            bookmarkOptions = richEditControl1.Options.Bookmarks;
            bookmarkOptions.ConflictNameResolution = ConflictNameAction.Rename;
            bookmarkOptions.Visibility             = RichEditBookmarkVisibility.Hidden;
            #endregion #BookmarkOptions
        }
コード例 #10
0
 public BookmarkCallbackWrapper(BookmarkCallback callback, System.Activities.ActivityInstance owningInstance, BookmarkOptions bookmarkOptions) : base(callback, owningInstance)
 {
     this.Options = bookmarkOptions;
 }
コード例 #11
0
        public Bookmark CreateBookmark(BookmarkCallback callback, ActivityInstance owningInstance, BookmarkOptions options)
        {
            Fx.Assert(this.scope == null, "We only support named bookmarks within bookmark scopes right now.");

            Bookmark bookmark = Bookmark.Create(GetNextBookmarkId());
            AddBookmark(bookmark, callback, owningInstance, options);
            //Regular bookmarks are never important
            UpdateAllExclusiveHandles(bookmark, owningInstance);

            return bookmark;
        }
コード例 #12
0
        public BookmarkCallbackWrapper(BookmarkCallback callback, ActivityInstance owningInstance, BookmarkOptions bookmarkOptions)
            : base(callback, owningInstance)
        {
            Fx.Assert(callback != null || bookmarkOptions == BookmarkOptions.None, "Either we have a callback or we only allow SingleFire, Blocking bookmarks.");

            this.Options = bookmarkOptions;
        }
コード例 #13
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 Microsoft.CoreWf.Internals.FxTrace.Exception.AsError(new InvalidOperationException(SR.RegisteredBookmarkScopeRequired));
            }

            return(manager.CreateBookmark(name, callback, owningInstance, options));
        }
コード例 #14
0
        private void AddBookmark(Bookmark bookmark, BookmarkCallback callback, ActivityInstance owningInstance, BookmarkOptions options)
        {
            if (this.bookmarks == null)
            {
                this.bookmarks = new Dictionary <Bookmark, BookmarkCallbackWrapper>(Bookmark.Comparer);
            }

            bookmark.Scope = this.scope;

            BookmarkCallbackWrapper bookmarkCallbackWrapper = new BookmarkCallbackWrapper(callback, owningInstance, options)
            {
                Bookmark = bookmark
            };

            this.bookmarks.Add(bookmark, bookmarkCallbackWrapper);

            owningInstance.AddBookmark(bookmark, options);

            if (TD.CreateBookmarkIsEnabled())
            {
                TD.CreateBookmark(owningInstance.Activity.GetType().ToString(), owningInstance.Activity.DisplayName, owningInstance.Id, ActivityUtilities.GetTraceString(bookmark), ActivityUtilities.GetTraceString((BookmarkScope)bookmark.Scope));
            }
        }
コード例 #15
0
 private static bool IsDefined(BookmarkOptions options)
 {
     return(options == BookmarkOptions.None || ((options & (BookmarkOptions.MultipleResume | BookmarkOptions.NonBlocking)) == options));
 }
コード例 #16
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);
        }
コード例 #17
0
 public static bool SupportsMultipleResumes(BookmarkOptions options)
 {
     return (options & BookmarkOptions.MultipleResume) == BookmarkOptions.MultipleResume;
 }
コード例 #18
0
 public Bookmark CreateBookmark(BookmarkCallback callback, BookmarkOptions options)
 {
     throw new NotImplementedException();
 }
コード例 #19
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));
        }
コード例 #20
0
        public Bookmark CreateBookmark(BookmarkCallback callback, System.Activities.ActivityInstance owningInstance, BookmarkOptions options)
        {
            Bookmark bookmark = Bookmark.Create(this.GetNextBookmarkId());

            this.AddBookmark(bookmark, callback, owningInstance, options);
            this.UpdateAllExclusiveHandles(bookmark, owningInstance);
            return(bookmark);
        }
コード例 #21
0
        public Bookmark CreateBookmark(BookmarkCallback callback, ActivityInstance owningInstance, BookmarkOptions options)
        {
            Fx.Assert(this.scope == null, "We only support named bookmarks within bookmark scopes right now.");

            Bookmark bookmark = Bookmark.Create(GetNextBookmarkId());

            AddBookmark(bookmark, callback, owningInstance, options);
            //Regular bookmarks are never important
            UpdateAllExclusiveHandles(bookmark, owningInstance);

            return(bookmark);
        }
コード例 #22
0
        public Bookmark CreateBookmark(string name, BookmarkCallback callback, ActivityInstance owningInstance, BookmarkOptions options)
        {
            Bookmark toAdd = new Bookmark(name);

            if (this.bookmarks != null && this.bookmarks.ContainsKey(toAdd))
            {
                throw FxTrace.Exception.AsError(new InvalidOperationException(SR.BookmarkAlreadyExists(name)));
            }

            AddBookmark(toAdd, callback, owningInstance, options);
            //Regular bookmarks are never important
            UpdateAllExclusiveHandles(toAdd, owningInstance);

            return(toAdd);
        }
コード例 #23
0
 public Bookmark CreateBookmark(string name, BookmarkCallback callback, BookmarkScope scope, BookmarkOptions options)
 {
     throw new NotImplementedException();
 }
コード例 #24
0
 public static bool SupportsMultipleResumes(BookmarkOptions options)
 {
     return((options & BookmarkOptions.MultipleResume) == BookmarkOptions.MultipleResume);
 }
コード例 #25
0
 static bool IsDefined(BookmarkOptions options)
 {
     return options == BookmarkOptions.None || ((options & (BookmarkOptions.MultipleResume | BookmarkOptions.NonBlocking)) == options);
 }
コード例 #26
0
 public static bool IsNonBlocking(BookmarkOptions options)
 {
     return((options & BookmarkOptions.NonBlocking) == BookmarkOptions.NonBlocking);
 }
コード例 #27
0
 public static bool IsNonBlocking(BookmarkOptions options)
 {
     return (options & BookmarkOptions.NonBlocking) == BookmarkOptions.NonBlocking;
 }
コード例 #28
0
        public Bookmark CreateBookmark(string name, BookmarkCallback callback, System.Activities.ActivityInstance owningInstance, BookmarkOptions options)
        {
            Bookmark key = new Bookmark(name);

            if ((this.bookmarks != null) && this.bookmarks.ContainsKey(key))
            {
                throw FxTrace.Exception.AsError(new InvalidOperationException(System.Activities.SR.BookmarkAlreadyExists(name)));
            }
            this.AddBookmark(key, callback, owningInstance, options);
            this.UpdateAllExclusiveHandles(key, owningInstance);
            return(key);
        }