/// <summary> /// Creates a <see cref="T:PageLinker"/> using the specified parameters. /// </summary> /// <param name="isBase1"><c>true</c> to use base-1 page numbers. Otherwise, <c>false</c>.</param> /// <param name="prevText">The text to be displayed for the previous page.</param> /// <param name="nextText">The text to be displayed for the next page.</param> /// <param name="forcePrevNext"><c>true</c> to always add previous- and next-page links. Otherwise, <c>false</c>.</param> /// <returns>A <see cref="T:PageLinker"/> that will link pages using the specified parameters.</returns> public static PageLinker Create(bool isBase1, string prevText, string nextText, bool forcePrevNext) { var baseLinker = new NumberLinker(isBase1); if (string.IsNullOrEmpty(prevText) && string.IsNullOrEmpty(nextText)) { return baseLinker; } return new PrevNextLinker(baseLinker, prevText, nextText, forcePrevNext); }
public void Default_CanBeSet() { var def = new NumberLinker(true); PageLinker.Default = def; Assert.AreSame(def, PageLinker.Default); }