示例#1
0
 public static void BuildRegionList(DataRow inputRow, DataTable dataTable, DataObjectStore store)
 {
     dataTable.BeginLoadData();
     Array.ForEach <string>(HygieneUtils.iso3166Alpha2Codes, delegate(string code)
     {
         string text = code.ToUpper().ToString();
         string regionDisplayName = Antispam.GetRegionDisplayName(text);
         DataRow dataRow          = dataTable.NewRow();
         dataRow["RegionCode"]    = text;
         dataRow["RegionName"]    = regionDisplayName;
         dataRow["Identity"]      = new Identity(text, regionDisplayName);
         dataTable.Rows.Add(dataRow);
     });
     dataTable.EndLoadData();
 }
示例#2
0
        public static void GetContentFilterPostAction(DataRow inputRow, DataTable dataTable, DataObjectStore store)
        {
            if (dataTable.Rows.Count == 0)
            {
                return;
            }
            DataRow row = dataTable.Rows[0];

            Antispam.contentEmailListParameters.ForEach(delegate(string p)
            {
                if (!row[p].IsNullValue())
                {
                    MultiValuedProperty <SmtpAddress> multiValuedProperty = (MultiValuedProperty <SmtpAddress>)row[p];
                    row[string.Format("str{0}", p)] = multiValuedProperty.ToStringArray <SmtpAddress>().StringArrayJoin("; ");
                }
            });
            List <Identity> list         = new List <Identity>();
            List <Identity> list2        = new List <Identity>();
            LanguageList    languageList = new LanguageList();

            if (!row["RegionBlockList"].IsNullValue())
            {
                foreach (string text in ((MultiValuedProperty <string>)row["RegionBlockList"]))
                {
                    list.Add(new Identity(text.ToString(), Antispam.GetRegionDisplayName(text)));
                }
                row["regionList"] = list.ToArray();
            }
            if (!row["LanguageBlockList"].IsNullValue())
            {
                foreach (string text2 in ((MultiValuedProperty <string>)row["LanguageBlockList"]))
                {
                    list2.Add(new Identity(text2.ToString(), RtlUtil.ConvertToDecodedBidiString(languageList.GetDisplayValue(text2), RtlUtil.IsRtl)));
                }
                row["languageList"] = list2.ToArray();
            }
        }