SIL.FieldWorks.Common.Framework.DetailControls.ViewSlice.SetHeightFromRootBox C# (CSharp) Method

SetHeightFromRootBox() private method

private SetHeightFromRootBox ( SIL.FieldWorks.Common.RootSites.RootSite rs ) : void
rs SIL.FieldWorks.Common.RootSites.RootSite
return void
		private void SetHeightFromRootBox(RootSite rs)
		{
			if (rs.RootBox != null)
			{
				//Debug.WriteLine(String.Format("ViewSlice.SetHeightFromRootBox(): orig rs.Size = {0}, this.Size = {1}",
				//    rs.Size.ToString(), this.Size.ToString()));
				int widthOrig = rs.Width;
				this.Height = Math.Max(LabelHeight, DesiredHeight(rs));  // Allow it to be the height it wants.
				//Debug.WriteLine(String.Format("ViewSlice.SetHeightFromRootBox(): new rs.Size = {0}, this.Size = {1}",
				//    rs.Size.ToString(), this.Size.ToString()));
				if (widthOrig != rs.Width)
				{
					// If the rootsite width changes, we need to layout again.  See LT-6156.  (This is too much
					// like a band-aid, but it's taken me 3 days to figure even this much out!)
					rs.AllowLayout = true;
					this.Height = Math.Max(LabelHeight, DesiredHeight(rs));
				//    Debug.WriteLine(String.Format("ViewSlice.SetHeightFromRootBox(): final rs.Size = {0}, this.Size = {1}",
				//        rs.Size.ToString(), this.Size.ToString()));
				}
			}
		}