本文整理汇总了C#中Visitor.Submit方法的典型用法代码示例。如果您正苦于以下问题:C# Visitor.Submit方法的具体用法?C# Visitor.Submit怎么用?C# Visitor.Submit使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Visitor
的用法示例。
在下文中一共展示了Visitor.Submit方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Initialize
protected void Initialize()
{
// Retrieve created content items
m_testRoot = m_home.Axes.GetChild("weblog testroot");
m_blog1 = m_testRoot.Axes.GetChild("blog1");
m_blog2 = m_testRoot.Axes.GetChild("blog2");
m_entry11 = m_blog1.Axes.GetDescendant("Entry1");
m_entry12 = m_blog1.Axes.GetDescendant("Entry2");
m_entry13 = m_blog1.Axes.GetDescendant("Entry3");
m_entry21 = m_blog2.Axes.GetDescendant("Entry1");
m_entry22 = m_blog2.Axes.GetDescendant("Entry2");
m_entry23 = m_blog2.Axes.GetDescendant("Entry3");
var blog1Categories = m_blog1.Axes.GetChild("categories");
m_category12 = blog1Categories.Axes.GetChild("category2");
m_category13 = blog1Categories.Axes.GetChild("category3");
var blog2Categories = m_blog2.Axes.GetChild("categories");
m_category21 = blog2Categories.Axes.GetChild("category1");
m_category22 = blog2Categories.Axes.GetChild("category2");
m_comment1 = m_entry21.Axes.GetDescendant("comment1");
// rebuild the WeBlog search index (or the entry manager won't work)
var index = SearchManager.GetIndex(Settings.SearchIndexName);
index.Rebuild();
#if PRE_65
//Sitecore.Analytics.AnalyticsTracker.Current.
#else
if (Sitecore.Configuration.Settings.Analytics.Enabled)
{
// Register DMS page views for popular items
var visitor = new Visitor(Guid.NewGuid());
visitor.CreateVisit(Guid.NewGuid());
visitor.CurrentVisit.CreatePage().ItemId = m_entry13.ID.ToGuid();
visitor.CurrentVisit.CreatePage().ItemId = m_entry13.ID.ToGuid();
visitor.CurrentVisit.CreatePage().ItemId = m_entry13.ID.ToGuid();
visitor.CurrentVisit.CreatePage().ItemId = m_entry11.ID.ToGuid();
visitor.CurrentVisit.CreatePage().ItemId = m_entry11.ID.ToGuid();
visitor.CurrentVisit.CreatePage().ItemId = m_entry12.ID.ToGuid();
visitor.Submit();
}
#endif
}
示例2: CreateEntryManagerForAnalyticsTest
private EntryManager CreateEntryManagerForAnalyticsTest(params ID[] popularEntryIdsInOrder)
{
#if FEATURE_XDB
var reportProvider = CreateMockReportDataProvider(popularEntryIdsInOrder);
return new EntryManager(reportProvider, null);
#else
// Register DMS page views for popular items
var visitor = new Visitor(Guid.NewGuid());
visitor.CreateVisit(Guid.NewGuid());
var hitCount = 1;
for(var i = popularEntryIdsInOrder.Length - 1; i >= 0; i--)
{
for(var j = 0; j < hitCount; j++)
{
visitor.CurrentVisit.CreatePage().ItemId = popularEntryIdsInOrder[i].ToGuid();
}
hitCount++;
}
visitor.Submit();
return new EntryManager();
#endif
}