/// -----------------------------------------------------------------------------
 /// <summary>
 /// The DeleteAuthentiation method deletes the Authentication System
 /// from the data Store.
 /// </summary>
 /// -----------------------------------------------------------------------------
 private void DeleteAuthentiation()
 {
     try
     {
         AuthenticationInfo authSystem = AuthenticationController.GetAuthenticationServiceByPackageID(Package.PackageID);
         if (authSystem != null)
         {
             AuthenticationController.DeleteAuthentication(authSystem);
         }
         Log.AddInfo(string.Format(Util.AUTHENTICATION_UnRegistered, authSystem.AuthenticationType));
     }
     catch (Exception ex)
     {
         Log.AddFailure(ex);
     }
 }
        public void DeleteExtensionPackage(PackageInfo package)
        {
            switch (package.PackageType)
            {
            case "Auth_System":
                AuthenticationInfo authSystem = AuthenticationController.GetAuthenticationServiceByPackageID(package.PackageID);
                if (authSystem != null)
                {
                    AuthenticationController.DeleteAuthentication(authSystem);
                }

                break;

            case "CoreLanguagePack":
                LanguagePackInfo languagePack = LanguagePackController.GetLanguagePackByPackage(package.PackageID);
                if (languagePack != null)
                {
                    LanguagePackController.DeleteLanguagePack(languagePack);
                }

                break;

            case "Module":
                var controller = new DesktopModuleController();
                DesktopModuleInfo desktopModule = DesktopModuleController.GetDesktopModuleByPackageID(package.PackageID);
                if (desktopModule != null)
                {
                    controller.DeleteDesktopModule(desktopModule);
                }

                break;

            case "SkinObject":
                SkinControlInfo skinControl = SkinControlController.GetSkinControlByPackageID(package.PackageID);
                if (skinControl != null)
                {
                    SkinControlController.DeleteSkinControl(skinControl);
                }

                break;
            }

            DeletePackageInternal(package);
        }