public RsopPot RsopPotsEqual(List <RsopPot> rsopPots, Rsop currentRsop) { RsopPot foundPot = null; foreach (var pot in rsopPots) { var rsop = pot.Rsops.FirstOrDefault(); if (rsop == null) { continue; } var auditSettingsEqual = SettingsEqual(rsop.AuditSettings, currentRsop.AuditSettings); if (!auditSettingsEqual) { continue; } var policiesEqual = SettingsEqual(rsop.Policies, currentRsop.Policies); if (!policiesEqual) { continue; } var registrySettingsEqual = SettingsEqual(rsop.RegistrySettings, currentRsop.RegistrySettings); if (!registrySettingsEqual) { continue; } var securityOptionsEqual = SettingsEqual(rsop.SecurityOptions, currentRsop.SecurityOptions); if (!securityOptionsEqual) { continue; } var domainsEqual = rsop.Domain.Equals(currentRsop.Domain); if (!domainsEqual) { continue; } if (RsopAndRsopPotsOuEqual(currentRsop, rsop)) { continue; } pot.Rsops.Add(currentRsop); foundPot = pot; break; } return(foundPot); }
private static TreeNode NewRsopPotNode(RsopPot rsopPot) { return(new TreeNode { Description = rsopPot.Name, IsRSoP = true, TypeRefIdDictionary = new Dictionary <string, int> { { "RSoPPot", rsopPot.RsopPotId } }, Identifier = rsopPot.DateTime, AnalysisPercentage = rsopPot.Rsops.First().RsopPercentage, OrganizationalUnits = rsopPot.Rsops.Select(rsop => rsop.OrganizationalUnit).ToList(), Rsop = rsopPot.Rsops.FirstOrDefault() }); }