本文整理汇总了C#中PageData类的典型用法代码示例。如果您正苦于以下问题:C# PageData类的具体用法?C# PageData怎么用?C# PageData使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
PageData类属于命名空间,在下文中一共展示了PageData类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ScrapeData
public PageData ScrapeData(bool useCurrent = true)
{
RunUserScript();
ScrapePage();
var size = GetViewportSize();
var cookies = GetCookies();
var screenshot = GetScreenshotImage();
var resources = GetPageResources();
var pageData = new PageData
{
BrowserName = "PhantomJS",
BrowserVersion = string.Empty,
Platform = "Windows",
Cookies = cookies,
ElementsJson = _elements,
Html = _html,
Resources = resources,
Screenshot = screenshot,
Size = size,
Url = _request.Url
};
return pageData;
}
示例2: PageListBlockItemViewModel
public PageListBlockItemViewModel(PageData page)
{
Title = page.Name;
ContentLink = page.ContentLink;
Text = GetPageListBlockItemText(page);
_imageUrl = GetPageListBlockItemImageUrl(page);
}
示例3: AddItemTemplate
/// <summary>
/// Adds an item with the specified template.
/// </summary>
/// <param name="template"></param>
/// <param name="item"></param>
/// <param name="itemNumber"></param>
/// <param name="selected"></param>
protected void AddItemTemplate(ITemplate template, PageData item, int itemNumber, bool selected)
{
if (AddSeparator)
AddSeparatorTemplate();
AddTemplate(new PageDataItemTemplateContainer(item, itemNumber, selected), template);
Added = true;
}
示例4: SetupTeardownIncluder
private SetupTeardownIncluder(PageData pageData)
{
this.isIssue = pageData;
testPage = pageData.getWikiPage();
pageCrawler = testPage.getPageCrawler();
newPageContent = new StringBuffer();
}
示例5: DocumentSavingEventArgs
public DocumentSavingEventArgs(Document document, PageData pageData)
{
Document = document;
PageData = pageData;
ExcludeDefaultDocumentFromIndex = false;
AdditionalDocuments = new List<DocumentData>();
}
示例6: Should_Return_Correct_Search_Results
public void Should_Return_Correct_Search_Results()
{
var document1 = new HtmlDocument();
document1.DocumentNode.AppendChild(HtmlNode.CreateNode("<title>Test title</title>"));
document1.DocumentNode.AppendChild(HtmlNode.CreateNode("<body><p>Body with search phrase test</p></body>"));
var document2 = new HtmlDocument();
document2.DocumentNode.AppendChild(HtmlNode.CreateNode("<title>Test title</title>"));
document2.DocumentNode.AppendChild(HtmlNode.CreateNode("<body><p>Body without search phrase</p></body>"));
var page1 = new PageData { AbsolutePath = "/test-1", Content = document1, Id = Guid.NewGuid(), IsPublished = true};
var page2 = new PageData { AbsolutePath = "/test-2", Content = document2, Id = Guid.NewGuid(), IsPublished = true };
var service = new DefaultIndexerService(Container.Resolve<ICmsConfiguration>(), Container.Resolve<IRepository>(),
Container.Resolve<ISecurityService>(), Container.Resolve<IAccessControlService>());
if (service.OpenWriter())
{
service.AddHtmlDocument(page1);
service.AddHtmlDocument(page2);
service.CloseWriter();
}
var results = service.Search(new SearchRequest("test"));
Assert.IsNotNull(results.Items);
Assert.AreEqual(results.Items.Count, 1, "Should return one item.");
Assert.IsTrue(results.Items[0].Link == page1.AbsolutePath);
}
示例7: From
public static PageResult From(PageData item, ISessionAwareCoreService client, string currentUserId)
{
var template = (PageTemplateData)client.Read(item.PageTemplate.IdRef, new ReadOptions());
string extension = template.FileExtension;
var result = new PageResult
{
Template = LinkEntry.From(item.PageTemplate, Resources.LabelTemplate, currentUserId),
FileName = TextEntry.From(string.Format(CultureInfo.InvariantCulture, "{0}.{1}", item.FileName, extension), Resources.LabelFileName),
};
if (result.FileName != null)
{
result.PathOnWebsite = GetPublishPath(item.LocationInfo as PublishLocationInfo, result.FileName.Value);
}
string componentPresentations = Resources.None;
if (item.ComponentPresentations.Any())
{
int count = item.ComponentPresentations.Count();
int templateCount = item.ComponentPresentations.DistinctBy(cp => cp.ComponentTemplate.IdRef).Count();
componentPresentations = (templateCount == 1)
? string.Format(CultureInfo.InvariantCulture, Resources.ComponentPresentationSummarySameTemplate, count)
: string.Format(CultureInfo.InvariantCulture, Resources.ComponentPresentationSummary, count, templateCount);
}
result.ComponentPresentations = TextEntry.From(componentPresentations, Resources.LabelComponentPresentations);
AddCommonProperties(item, result);
AddPropertiesForRepositoryLocalObject(item, result, currentUserId);
return result;
}
示例8: PageTraded
public void PageTraded(PageData pageTraded)
{
foreach (IShopEventListener listener in IterateListeners<IShopEventListener>())
{
listener.PageTraded(pageTraded);
}
}
示例9: SubmitPageForRoom
public void SubmitPageForRoom(PageData dataToSubmit)
{
foreach (IPageForRoomEventListener listener in IterateListeners<IPageForRoomEventListener>())
{
listener.SubmitPageForRoom(dataToSubmit);
}
}
示例10: ExtractLinks
public LinkStatus ExtractLinks()
{
if (String.Empty == m_strUrl)
{
throw new ArgumentException("No URL specified");
}
m_Links = new ImageDataCollection();
CreateParser();
if (m_obParser.Lexer.Page.mSource == null)
{
return LinkStatus.Broken;
}
INodeFilter obFilter = new NodeClassFilter(typeof(ImageTag));
NodeList collNodes = m_obParser.Parse(obFilter);
if (null != collNodes)
{
PageData obPageData = new PageData();
obPageData.m_strUrl = m_obParser.URL;
obPageData.m_iDepth = m_iLevel;
for(Int32 i= 0; i < collNodes.Count; i++)
{
INode obNode = collNodes[i];
ImageData obLinkData = new ImageData(obPageData, obNode as ImageTag);
m_Links.Add(obLinkData);
}
}
return LinkStatus.Ok;
}
示例11: PageData
public void GivenPageWithPropertyValueAndPropertyGroups_CreateAndPopulateTypedInstance_ReturnsTypedInstanceWithPropertyValues()
{
PageData sourcePage = new PageData();
sourcePage.Property.Add("LongStringProperty", new PropertyString());
sourcePage.SetValue("LongStringProperty", "one");
sourcePage.Property.Add("ImageOne-ImageUrl", new PropertyString());
sourcePage.SetValue("ImageOne-ImageUrl", "two");
sourcePage.Property.Add("ImageOne-AltText", new PropertyString());
sourcePage.SetValue("ImageOne-AltText", "three");
sourcePage.Property.Add("ImageTwo-ImageUrl", new PropertyString());
sourcePage.SetValue("ImageTwo-ImageUrl", "four");
sourcePage.Property.Add("ImageTwo-AltText", new PropertyString());
sourcePage.SetValue("ImageTwo-AltText", "five");
sourcePage.Property.Add("ImageThree-ImageUrl", new PropertyString());
sourcePage.SetValue("ImageThree-ImageUrl", "six");
sourcePage.Property.Add("ImageThree-AltText", new PropertyString());
sourcePage.SetValue("ImageThree-AltText", "seven");
TypedPageActivator activator = new TypedPageActivator();
TestPageTypeWithPropertyGroups page = activator.CreateAndPopulateTypedInstance(sourcePage, typeof(TestPageTypeWithPropertyGroups)) as TestPageTypeWithPropertyGroups;
Assert.Equal("one", page.LongStringProperty);
Assert.Equal("two", page.ImageOne.ImageUrl);
Assert.Equal("three", page.ImageOne.AltText);
Assert.Equal("four", page.ImageTwo.ImageUrl);
Assert.Equal("five", page.ImageTwo.AltText);
Assert.Equal("six", page.ImageThree.ImageUrl);
Assert.Equal("seven", page.ImageThree.AltText);
}
示例12: QueryData
public QueryData()
{
Page = new PageData
{
Number = 0,
Size = 10
};
}
示例13: LinkData
/// <summary>
/// Creates new instance of <see cref="LinkData"></see> object.
/// </summary>
/// <param name="obPage"></param>
public LinkData(PageData obPage)
{
if (null == obPage)
{
throw new ArgumentNullException("obPage", "Null Page object specified");
}
this.m_Page = obPage;
}
示例14: IsAccessibleToEveryone
private static bool IsAccessibleToEveryone(PageData page)
{
var visitorPrinciple = new System.Security.Principal.GenericPrincipal(
new System.Security.Principal.GenericIdentity("visitor"),
new[] { "Everyone" });
return page.ACL.QueryDistinctAccess(visitorPrinciple, EPiServer.Security.AccessLevel.Read);
}
示例15: HasChildren
/// <summary>
/// Checks if the specified page has any children that should be visible in the menu
/// </summary>
/// <param name="page"></param>
/// <returns></returns>
protected bool HasChildren(PageData page)
{
//Use lookup to avoid multiple expensive calls to this method fropm the markup
return _hasChildrenlookup.GetOrAdd(page.PageLink, (pageLink) =>
{
return DataFactory.Instance.GetChildren(pageLink, 0, 10)
.Any(p => !_treeFilter.ShouldFilter(p) && p.VisibleInMenu);
});
}