public void Activate()
{
if (activated)
throw new InvalidOperationException ("The host is already activated");
//select the root component
ISelectionService sel = GetService (typeof (ISelectionService)) as ISelectionService;
if (sel == null)
throw new Exception ("Could not obtain ISelectionService.");
if (this.RootComponent == null)
throw new InvalidOperationException ("The document must be loaded before the host can be activated");
sel.SetSelectedComponents (new object[] {this.RootComponent});
activated = true;
OnActivated ();
}