Exemplo n.º 1
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);
        }