private static void MergeFeatureThemes(SPFeatureDefinition def, bool delete)
        {
            if (def == null)
            {
                throw new ArgumentNullException("def");
            }

            SPFarm f = def.Farm;

            if (f == null)
            {
                f = SPFarm.Local;
            }

            foreach (SPWebService svc in new SPWebServiceCollection(f))
            {
                FeatureThemesJob itj = new FeatureThemesJob(svc, def.Id, delete);
                itj.SubmitJobNow();
            }
        }
 public override void FeatureDeactivating(SPFeatureReceiverProperties properties)
 {
     FeatureThemesJob.DeleteThemes(properties.Definition);
 }
 public override void FeatureActivated(SPFeatureReceiverProperties properties)
 {
     FeatureThemesJob.InstallThemes(properties.Definition);
 }