internal static IDictionaryService GetDictionaryService(object component)
{
if (component == null)
throw new ArgumentNullException ("component");
IComponent comp = component as IComponent;
if (comp == null || comp.Site == null)
throw new ArgumentException ("component must be a sited IComponent", "component");
IDictionaryService dict = comp.Site.GetService (typeof (IDictionaryService)) as IDictionaryService;
if (dict == null)
throw new InvalidOperationException ("could not obtain IDictionaryService implementation");
return dict;
}