/// <summary> /// Adds <paramref name="page"/> to the currently-opened document. This differs from <see cref="AddResource"/> /// in that this method also adds <paramref name="page"/> to the document page order list, too. If /// <paramref name="after"/> is not <c>null</c>, then <paramref name="page"/> will be added after /// <paramref name="after"/> in the page order list. If <paramref name="after"/> is <c>null</c>, then /// <paramref name="page"/> will simply be added to the end of the page order list. /// </summary> /// <param name="page">The page to add to the document.</param> /// <param name="after">The page to add <paramref name="page"/> after in the page order list, or <c>null</c> to /// add <paramref name="page"/> to the end of the page order list.</param> private void AddPage(Page page, Page after = null) { CurrentDocument.Add(page); DocumentModified = true; CurrentDocument.AddPageToPageOrder(page, after); RefreshResourceListView(); }
/// <summary> /// Adds <paramref name="resource"/> to the currently-opened document. This correctly handles /// if <paramref name="resource"/> is a <see cref="Graphmatic.Interaction.Page"/> by calling the /// <see cref="AddPage"/> method rather than adding it normally. /// </summary> /// <param name="resource">The resource to add to the document.</param> private void AddResource(Resource resource) { if (resource is Page) { AddPage(resource as Page); } else { CurrentDocument.Add(resource); DocumentModified = true; RefreshResourceListView(); } }