public static void Validate(BookmarkOptions options, string argumentName) { if (!IsDefined(options)) { throw FxTrace.Exception.AsError(new InvalidEnumArgumentException(argumentName, (int) options, typeof(BookmarkOptions))); } }
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; }
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); }
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 }
public BookmarkCallbackWrapper(BookmarkCallback callback, System.Activities.ActivityInstance owningInstance, BookmarkOptions bookmarkOptions) : base(callback, owningInstance) { this.Options = bookmarkOptions; }
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; }
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)); }
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)); } }
private static bool IsDefined(BookmarkOptions options) { return(options == BookmarkOptions.None || ((options & (BookmarkOptions.MultipleResume | BookmarkOptions.NonBlocking)) == options)); }
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); }
public static bool SupportsMultipleResumes(BookmarkOptions options) { return (options & BookmarkOptions.MultipleResume) == BookmarkOptions.MultipleResume; }
public Bookmark CreateBookmark(BookmarkCallback callback, BookmarkOptions options) { throw new NotImplementedException(); }
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)); }
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); }
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); }
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); }
public Bookmark CreateBookmark(string name, BookmarkCallback callback, BookmarkScope scope, BookmarkOptions options) { throw new NotImplementedException(); }
public static bool SupportsMultipleResumes(BookmarkOptions options) { return((options & BookmarkOptions.MultipleResume) == BookmarkOptions.MultipleResume); }
static bool IsDefined(BookmarkOptions options) { return options == BookmarkOptions.None || ((options & (BookmarkOptions.MultipleResume | BookmarkOptions.NonBlocking)) == options); }
public static bool IsNonBlocking(BookmarkOptions options) { return((options & BookmarkOptions.NonBlocking) == BookmarkOptions.NonBlocking); }
public static bool IsNonBlocking(BookmarkOptions options) { return (options & BookmarkOptions.NonBlocking) == BookmarkOptions.NonBlocking; }
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); }