Beispiel #1
0
 protected void NormalizeProfiles(AnalyticsItems analytics)
 {
     Assert.ArgumentNotNull(analytics, "analytics");
     foreach (ProfileItem profileItem1 in analytics.Profiles)
     {
         ProfileItem    profileItem = profileItem1;
         ContentProfile profile     = null;
         // NM: Replaced the list first or default with a dictionary contains key
         string profileKey = profileItem.Name;
         if (profilesDictionary.ContainsKey(profileKey))
         {
             profile = profilesDictionary[profileKey];
         }
         if (profile == null)
         {
             profile = new ContentProfile(profileItem)
             {
                 IsSavedInField = false
             };
             profiles.Add(profile);
             profilesDictionary.Add(profileKey, profile);
         }
         ProcessProfileKeys(profile, profileItem);
     }
 }
Beispiel #2
0
        protected void InitializeProfiles()
        {
            profiles = new List <ContentProfile>();
            AnalyticsItems analytics = InnerField.Database.Analytics(InnerField.Language);

            if (!string.IsNullOrEmpty(Value))
            {
                foreach (XElement node in Root.Elements("profile"))
                {
                    // NM: Don't know the usage ouside of the tracking field, but internally, it only ever uses first or default. Dictionary should be quicker

                    ContentProfile contentProfile = ContentProfile.Parse(node, InnerField.Item, analytics);
                    if (contentProfile != null)
                    {
                        contentProfile.IsSavedInField = true;
                        profiles.Add(contentProfile);
                        string profileKey = contentProfile.Name.ToLowerInvariant();
                        if (!profilesDictionary.ContainsKey(profileKey))
                        {
                            profilesDictionary.Add(profileKey, contentProfile);
                        }
                    }
                }
            }
            NormalizeProfiles(analytics);
        }
Beispiel #3
0
 public PageEventData(AnalyticsItems analytics, Guid pageEventDefinitionId)
 {
     Assert.ArgumentNotNull(analytics, "analytics");
     this.analytics        = analytics;
     PageEventDefinitionId = pageEventDefinitionId;
 }
Beispiel #4
0
 public PageEventData(AnalyticsItems analytics)
     : this(analytics, Guid.Empty)
 {
 }