public void UpdatePageSplitMode(XmlNode node)
{
//NB: this can currently only split pages, not move them together. Doable, just not called for by the UI or unit tested yet.
if (ElementDistribution == ElementDistributionChoices.CombinedPages)
return;
var combinedPages = node.SafeSelectNodes("descendant-or-self::div[contains(@class,'bloom-combinedPage')]");
foreach (XmlElement pageDiv in combinedPages)
{
XmlElement trailer = (XmlElement) pageDiv.CloneNode(true);
pageDiv.ParentNode.InsertAfter(trailer, pageDiv);
pageDiv.SetAttribute("class", pageDiv.GetAttribute("class").Replace("bloom-combinedPage", "bloom-leadingPage"));
var leader = pageDiv;
trailer.SetAttribute("class", trailer.GetAttribute("class").Replace("bloom-combinedPage", "bloom-trailingPage"));
//give all new ids to both pages
leader.SetAttribute("id", Guid.NewGuid().ToString());
trailer.SetAttribute("id", Guid.NewGuid().ToString());
//now split the elements
leader.DeleteNodes("descendant-or-self::*[contains(@class, 'bloom-trailingElement')]");
trailer.DeleteNodes("descendant-or-self::*[contains(@class, 'bloom-leadingElement')]");
}
}