• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C# PageData类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中PageData的典型用法代码示例。如果您正苦于以下问题:C# PageData类的具体用法?C# PageData怎么用?C# PageData使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



PageData类属于命名空间,在下文中一共展示了PageData类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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


示例16: GenerateSiteElement

        protected override XElement GenerateSiteElement(PageData pageData, string url)
        {
            var element = base.GenerateSiteElement(pageData, url);

            // add <mobile:mobile/> to standard sitemap url element
            element.Add(new XElement(MobileNamespace + "mobile"));

            return element;
        }
开发者ID:ErikM040566,项目名称:SEO.Sitemaps,代码行数:9,代码来源:MobileSitemapXmlGenerator.cs


示例17: UpdatePageList

    //Sets Page Data and adds to PageDataList
    private static void UpdatePageList(PageState _pageState)
    {
        //Create new PageData object and set stuff.
        PageData _pageData = new PageData();
        _pageData.State = _pageState;
        _pageData.ID = (int)_pageState.GetHashCode();//Get ID from enum HashCode 0-4

        //Update dictionary with ChapterState and ChapterData
        PageDataList.Add(_pageData);
    }
开发者ID:tkaniatobe,项目名称:UnityMVCFramework,代码行数:11,代码来源:ApplicationModel.cs


示例18: CreatNavigationItem

        private NavigationItem CreatNavigationItem(PageData x)
        {
            var navItem = new NavigationItem()
            {
                Name = x.Name,
                Link = x.LinkURL
            };

            return navItem;
        }
开发者ID:jondjones,项目名称:JonDJones.Com.EpiServerMegaMenu,代码行数:10,代码来源:ViewModelFactory.cs


示例19: RuleSideValidation

 private static bool RuleSideValidation(PageData pageToValidate, Rule rule, bool validateLeftSide)
 {
     if (ValidatePageType(rule, pageToValidate.PageTypeName, validateLeftSide))
     {
         int startPage = (validateLeftSide ? rule.RelationHierarchyStartLeft : rule.RelationHierarchyStartRight);
         if (startPage < 1 || IsDescendent(pageToValidate.PageLink.ID, startPage))
             return true;
     }
     return false;
 }
开发者ID:BVNetwork,项目名称:Relations,代码行数:10,代码来源:Validator.cs


示例20: MainPage

 // Constructor
 public MainPage()
 {
     InitializeComponent();
     Loaded += (sender, e) =>
     {
         var p = new PageData();
         this.DataContext = p;
         p.LoadData();
     };
 }
开发者ID:ChrisKoenig,项目名称:CrazyAzurePhoneProject,代码行数:11,代码来源:MainPage.xaml.cs



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# PageDefinition类代码示例发布时间:2022-05-24
下一篇:
C# Page类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap