private void GetPolicyRules(string target, List <MailFilterListReport> values)
 {
     values.AddRange(from rule in DlpUtils.GetTransportRules(base.ConfigSession, (Rule rule) => rule.DlpPolicyId == Guid.Empty)
                     select new MailFilterListReport
     {
         Organization    = this.Organization.ToString(),
         SelectionTarget = target,
         Display         = rule.Name,
         Value           = rule.Name
     });
 }
 private void GetDlpRules(string target, List <MailFilterListReport> values)
 {
     if (Schema.Utilities.HasDlpRole(this))
     {
         values.AddRange(from rule in DlpUtils.GetTransportRules(base.ConfigSession, (Rule rule) => rule.DlpPolicyId != Guid.Empty)
                         select new MailFilterListReport
         {
             Organization    = this.Organization.ToString(),
             SelectionTarget = target,
             Display         = rule.Name,
             Value           = rule.Name,
             ParentTarget    = GetMailFilterListReport.SelectionTargets.DlpPolicy.ToString(),
             ParentValue     = rule.DlpPolicy
         });
     }
 }
        internal void ValidateTransportRule(PropertyInfo property, object task, IConfigDataProvider configSession)
        {
            IList <string> list;

            if (this.TryGetValues <string>(property, task, out list) && list.Count > 0)
            {
                if (configSession == null)
                {
                    throw new NullReferenceException("ValidateTransportRule requires an IConfigDataProvider");
                }
                HashSet <string> installedRules = new HashSet <string>(from rule in DlpUtils.GetTransportRules(configSession, (Rule rule) => true)
                                                                       select rule.Name.ToLower());
                if (!list.All((string rule) => installedRules.Contains(rule.ToLower())))
                {
                    this.ThrowError(property);
                }
            }
        }