Esempio n. 1
0
        public Audience tag_and(HashSet <string> values)
        {
            if (allAudience != null)
            {
                allAudience = null;
            }
            AudienceTarget target = AudienceTarget.tag_and(values);

            this.allAudience = null;
            if (dictionary == null)
            {
                dictionary = new Dictionary <string, HashSet <string> >();
            }
            if (dictionary.ContainsKey(target.audienceType.ToString()))
            {
                HashSet <string> origin = dictionary[target.audienceType.ToString()];
                foreach (var item in values)
                {
                    origin.Add(item);
                }
            }
            else
            {
                dictionary.Add(target.audienceType.ToString(), values);
            }
            return(this.Check());
        }
Esempio n. 2
0
 public Audience registrationId(HashSet <string> values)
 {
     if (allAudience != null)
     {
         allAudience = null;
     }
     AddWithAudienceTarget(AudienceTarget.registrationId(values));
     return(this.Check());
 }
Esempio n. 3
0
 public Audience segment(HashSet <string> values)
 {
     if (allAudience != null)
     {
         allAudience = null;
     }
     AddWithAudienceTarget(AudienceTarget.segment(values));
     return(this.Check());
 }
Esempio n. 4
0
        public Audience tag(HashSet <string> values)
        {
            if (allAudience != null)
            {
                allAudience = null;
            }
            AudienceTarget target = AudienceTarget.tag(values);

            AddWithAudienceTarget(target);
            return(this.Check());
        }
Esempio n. 5
0
 private void AddWithAudienceTarget(AudienceTarget target)
 {
     Debug.Assert(target != null && target.valueBuilder != null);
     if (target != null && target.valueBuilder != null)
     {
         this.allAudience = null;
         if (dictionary == null)
         {
             dictionary = new Dictionary <string, HashSet <string> >();
         }
         if (dictionary.ContainsKey(target.audienceType.ToString()))
         {
             HashSet <string> origin = dictionary[target.audienceType.ToString()];
             foreach (var item in target.valueBuilder)
             {
                 origin.Add(item);
             }
         }
         else
         {
             dictionary.Add(target.audienceType.ToString(), target.valueBuilder);
         }
     }
 }