private object CreateService(IServiceContainer container, Type serviceType)
 {
     object service = null;
     if(typeof(IPythonLibraryManager) == serviceType)
     {
         libraryManager = new PythonLibraryManager(this);
         service = libraryManager as IPythonLibraryManager;
         RegisterForIdleTime();
     }
     return service;
 }
 protected override void Dispose(bool disposing)
 {
     try
     {
         if (componentID != 0)
         {
             IOleComponentManager mgr = GetService(typeof(SOleComponentManager)) as IOleComponentManager;
             if (mgr != null)
             {
                 mgr.FRevokeComponent(componentID);
             }
             componentID = 0;
         }
         if (null != libraryManager)
         {
             libraryManager.Dispose();
             libraryManager = null;
         }
     }
     finally
     {
         base.Dispose(disposing);
     }
 }