当前位置: 首页>>代码示例>>C#>>正文


C# PageData类代码示例

本文整理汇总了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;
        }
开发者ID:Ancestry,项目名称:quality-bot,代码行数:27,代码来源:PhantomJsFacade.cs

示例2: PageListBlockItemViewModel

 public PageListBlockItemViewModel(PageData page)
 {
     Title = page.Name;
     ContentLink = page.ContentLink;
     Text = GetPageListBlockItemText(page);
     _imageUrl = GetPageListBlockItemImageUrl(page);
 }
开发者ID:smchristenson,项目名称:CommerceStarterKit,代码行数:7,代码来源:PageListBlockItemViewModel.cs

示例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;
 }
开发者ID:JohannesOstensjo,项目名称:EPiUtilities,代码行数:14,代码来源:TemplatedPageDataItemListControlBase.cs

示例4: SetupTeardownIncluder

 private SetupTeardownIncluder(PageData pageData)
 {
     this.isIssue = pageData;
     testPage = pageData.getWikiPage();
     pageCrawler = testPage.getPageCrawler();
     newPageContent = new StringBuffer();
 }
开发者ID:mikemajesty,项目名称:Livro-CleanCode,代码行数:7,代码来源:SetupTeardownIncluder.cs

示例5: DocumentSavingEventArgs

 public DocumentSavingEventArgs(Document document, PageData pageData)
 {
     Document = document;
     PageData = pageData;
     ExcludeDefaultDocumentFromIndex = false;
     AdditionalDocuments = new List<DocumentData>();
 }
开发者ID:wezmag,项目名称:BetterCMS,代码行数:7,代码来源:DocumentSavingEventArgs.cs

示例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);
        }
开发者ID:vivekmalikymca,项目名称:BetterCMS,代码行数:29,代码来源:IndexerServiceTests.cs

示例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;
        }
开发者ID:pkjaer,项目名称:alchemy-plugins,代码行数:32,代码来源:PageResult.cs

示例8: PageTraded

 public void PageTraded(PageData pageTraded)
 {
     foreach (IShopEventListener listener in IterateListeners<IShopEventListener>())
     {
         listener.PageTraded(pageTraded);
     }
 }
开发者ID:Awesome-MQP,项目名称:Storybook,代码行数:7,代码来源:ShopUIEventDispatcher.cs

示例9: SubmitPageForRoom

 public void SubmitPageForRoom(PageData dataToSubmit)
 {
     foreach (IPageForRoomEventListener listener in IterateListeners<IPageForRoomEventListener>())
     {
         listener.SubmitPageForRoom(dataToSubmit);
     }
 }
开发者ID:Awesome-MQP,项目名称:Storybook,代码行数:7,代码来源:UIEventDispatcher.cs

示例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;
		}
开发者ID:JamalAbuDayyeh,项目名称:slowandsteadyparser,代码行数:30,代码来源:ImageLinkExtractor.cs

示例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);

        }
开发者ID:stenis,项目名称:Page-Type-Builder,代码行数:32,代码来源:TypedPageActivatorTests.cs

示例12: QueryData

 public QueryData()
 {
     Page = new PageData
         {
             Number = 0,
             Size = 10
         };
 }
开发者ID:chenhualei,项目名称:Target-Process-Plugins,代码行数:8,代码来源:QueryData.cs

示例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;
		}
开发者ID:JamalAbuDayyeh,项目名称:slowandsteadyparser,代码行数:12,代码来源:LinkData.cs

示例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);
        }
开发者ID:marijorg,项目名称:SEO.Sitemaps,代码行数:8,代码来源:PageFilter.cs

示例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);
         });
 }
开发者ID:shoobah,项目名称:episerverlab,代码行数:14,代码来源:SubNavigation.ascx.cs


注:本文中的PageData类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。