private int GetSelectionHvoFromControls(Slice slice)
{
if (slice.Control == null || slice.Control.Controls.Count == 0) return 0;
foreach (Control x in slice.Control.Controls)
{
if (x is RootSiteControl)
{
var site = x as SimpleRootSite;
if (site != null && site.RootBox != null)
{
var tsi = new TextSelInfo(site.RootBox);
return tsi.Hvo(true);
}
}
}
return 0; // no selection found
}