/// <summary> /// Reconstructs an image formatting rule from the specified XML image. /// </summary> /// <param name="node">The node containing the image formatting rule XML.</param> /// <returns>The image formatting rule.</returns> private static ImageFormattingRule ReadImageFormattingRuleXml(XmlNode node) { var formattingRule = new ImageFormattingRule(); if (XmlHelper.EvaluateSingleNode(node, "imageFormattingRule")) { XmlNode imageFormattingRuleNode = XmlHelper.SelectSingleNode(node, "imageFormattingRule"); if (imageFormattingRuleNode != null) { XmlNode scaleIdNode = imageFormattingRuleNode.SelectSingleNode("thumbnailScaleId"); if (scaleIdNode != null && !string.IsNullOrEmpty(scaleIdNode.InnerText)) { formattingRule.ThumbnailScaleId = EntityRef.FromXmlString(scaleIdNode.InnerText); } XmlNode sizeIdNode = imageFormattingRuleNode.SelectSingleNode("thumbnailSizeId"); if (sizeIdNode != null && !string.IsNullOrEmpty(sizeIdNode.InnerText)) { formattingRule.ThumbnailSizeId = EntityRef.FromXmlString(sizeIdNode.InnerText); } } } return(formattingRule); }