public override int EstimateHeight(int hvo, int frag, int dxAvailWidth)
{
// ENHANCE: May need to consider taking filter into consideration for getting better
// estimates.
switch (frag)
{
case (int)ScrFrags.kfrBook:
// Assume that any annotations in a book lazy box are not expanded yet...
IScrBookAnnotations bookAnnotations =
m_cache.ServiceLocator.GetInstance<IScrBookAnnotationsRepository>().GetObject(hvo);
int height = 0;
foreach (IScrScriptureNote note in bookAnnotations.NotesOS)
height += EstimateHeight(note.Hvo, (int)NotesFrags.kfrAnnotation, dxAvailWidth);
return height;
case (int)NotesFrags.kfrAnnotation:
return m_expandTable.ContainsKey(hvo) ? 112 : 14;
}
Debug.Assert(false, "unexpected frag");
return 14;
}