OneNoteConversionTool.OutputGenerator.OneNoteGenerator.GetPageHeight C# (CSharp) Method

GetPageHeight() public method

Get the height of the page
public GetPageHeight ( string pageId ) : double
pageId string id of the page
return double
		public double GetPageHeight(string pageId)
		{
			double retVal = 80.0;

			XmlDocument xmlPageDoc = GetPageContent(pageId);
			XmlNodeList nodeList = xmlPageDoc.SelectNodes("//*[one:Position]", GetNSManager(xmlPageDoc.NameTable));
			if (nodeList != null)
			{
				foreach (XmlNode node in nodeList)
				{
					XmlElement xmlPosition = node["one:Position"];
					XmlElement xmlSize = node["one:Size"];
					if (xmlPosition == null || xmlSize == null) continue;

					XmlAttribute xmlY = xmlPosition.Attributes["y"];
					XmlAttribute xmlHeight = xmlSize.Attributes["height"];

					double y = xmlY == null ? 0 : Double.Parse(xmlY.Value);
					double height = xmlHeight == null ? 0 : Double.Parse(xmlHeight.Value);

					retVal = Math.Max(retVal, y + height);
				}
			}

			return retVal;
		}