예제 #1
0
        protected virtual IEnumerable <KeyBehaviorCacheEntry> FilterKeyBehaviorCacheEntries(KeyBehaviorCache keyBehaviorCache)
        {
            Assert.ArgumentNotNull(keyBehaviorCache, "keyBehaviorCache");
            IEnumerable <KeyBehaviorCacheEntry> keyBehaviorCacheEntries = keyBehaviorCache.Campaigns.Concat(keyBehaviorCache.Channels).Concat(keyBehaviorCache.CustomValues).Concat(keyBehaviorCache.Goals)
                                                                          .Concat(keyBehaviorCache.Outcomes)
                                                                          .Concat(keyBehaviorCache.PageEvents)
                                                                          .Concat(keyBehaviorCache.Venues);
            IEnumerable <KeyBehaviorCacheEntry> enumerable = FilterKeyBehaviorCacheEntriesByInteractionConditions(keyBehaviorCacheEntries);

            if (filterByCustomData)
            {
                if (CustomData == null)
                {
                    Log.Warn("CustomData can not be null", GetType());
                    return(Enumerable.Empty <KeyBehaviorCacheEntry>());
                }
                enumerable = enumerable.Where(delegate(KeyBehaviorCacheEntry entry)
                {
                    if (entry.Data != null)
                    {
                        return(ConditionsUtility.CompareStrings(entry.Data, CustomData, CustomDataOperatorId));
                    }
                    return(false);
                });
            }
            return(Assert.ResultNotNull(GetKeyBehaviorCacheEntries(keyBehaviorCache).Intersect(enumerable, new KeyBehaviorCacheEntry.KeyBehaviorCacheEntryEqualityComparer())));
        }
 /// <summary>
 /// Compares the specified value0.
 /// </summary>
 /// <param name="value0">The value0.</param>
 /// <param name="value1">The value1.</param>
 /// <returns>The boolean.</returns>
 protected bool Compare(string value0, string value1)
 {
     Assert.ArgumentNotNull(value0, "value0");
     Assert.ArgumentNotNull(value1, "value1");
     return(ConditionsUtility.CompareStrings(value0, value1, this.OperatorId));
 }