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()); }
public Audience tag_and(HashSet <string> values) { if (this.allAudience != null) { this.allAudience = (string)null; } AudienceTarget audienceTarget = AudienceTarget.tag_and(values); this.allAudience = (string)null; if (this.dictionary == null) { this.dictionary = new Dictionary <string, HashSet <string> >(); } Dictionary <string, HashSet <string> > dictionary1 = this.dictionary; AudienceType audienceType = audienceTarget.audienceType; string key1 = audienceType.ToString(); if (dictionary1.ContainsKey(key1)) { Dictionary <string, HashSet <string> > dictionary2 = this.dictionary; audienceType = audienceTarget.audienceType; string index = audienceType.ToString(); HashSet <string> stringSet = dictionary2[index]; foreach (string str in values) { stringSet.Add(str); } } else { Dictionary <string, HashSet <string> > dictionary2 = this.dictionary; audienceType = audienceTarget.audienceType; string key2 = audienceType.ToString(); HashSet <string> stringSet = values; dictionary2.Add(key2, stringSet); } return(this.Check()); }