public void MergeEntryTo(HelpDescription helpDescription, Entry entry)
        {
            var pageGroups = events.GroupBy(e => e.Page);

            foreach (var pageGroup in pageGroups)
            {
                var page = helpDescription.Pages.FirstOrDefault(p => p.Path == pageGroup.Key);
                if (page == null)
                {
                    page = new Page {Path = pageGroup.Key};
                    helpDescription.Pages.Add(page);
                }

                var scopeGroups = pageGroup.GroupBy(e => new {e.ScopeType, e.ScopeKey});
                bool hasNonNavigate = scopeGroups.Any(sg => sg.Key.ScopeType != ScopeType.Navigate);
                if (hasNonNavigate)
                    scopeGroups = scopeGroups.Where(sg => sg.Key.ScopeType != ScopeType.Navigate);

                foreach (var scopeGroup in scopeGroups)
                {
                    var scope = page.Scopes.FirstOrDefault(s => s.Type == scopeGroup.Key.ScopeType && s.Key == scopeGroup.Key.ScopeKey);
                    if (scope == null)
                    {
                        scope = new Scope {Type = scopeGroup.Key.ScopeType, Key = scopeGroup.Key.ScopeKey};
                        page.Scopes.Add(scope);
                    }

                    scope.Entries.Add(entry);
                }
            }
        }
 public void MergeEvents()
 {
     Entry entry = new Entry
                       {
                           FeatureTitle = FeatureContext.Current.FeatureInfo.Title,
                           ScenarioTitle = ScenarioContext.Current.ScenarioInfo.Title,
                           Text = scenarioInfo == null ? null : scenarioInfo.Text,
                           Scenario = scenarioInfo == null ? null : scenarioInfo.Scenario,
                       };
     dataCollector.MergeEntryTo(helpDescription, entry);
 }