/// <summary> /// This method removes old compiled policies from a version cache. /// </summary> /// <param name="version">The PolicySetVersionCache to remove the items from</param> /// <param name="targets">The names of the target types you wish to remove.</param> private static void RemoveExistingPolicies(IPolicySetVersionCache version, string[] targets) { if (version.GetType() == typeof(Workshare.Policy.ClientCache.LocalPolicySetVersionCache)) { foreach (string target in targets) { TargetMatchPredicate matchingPredicate = new TargetMatchPredicate(target); version.CompiledPolicySets.RemoveAll(matchingPredicate.Evaluate); } } }
private static void SetVersionStatus(IPolicySetVersionCache policySetCache, PolicySetVersionStatus version) { // TODO: AP: Why not make IPolicySetVersionCache.Status writable? if (policySetCache is LocalPolicySetVersionCache) { (policySetCache as LocalPolicySetVersionCache).Status = version; } else { throw new NotImplementedException(string.Format(CultureInfo.CurrentCulture,"Unhandled policy set cache type \"{0}\"",policySetCache.GetType())); } }