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


C# System.PageInfo类代码示例

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


PageInfo类属于System命名空间,在下文中一共展示了PageInfo类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Page_Load

        protected void Page_Load(object sender, EventArgs e)
        {
            if (Request.QueryString["Page"] == null) {
                (Master as Dreadnought_Master).Message("No page specified. Please use the querystring Page to specify the full relative path to a page.");
                DisableAll();
                return;
            }

            pageInfo = new PageInfo(Request.QueryString["Page"]);
            try {
                pageInfo.Load();
            } catch (PageDoesNotExistException) {
                (Master as Dreadnought_Master).Message("The specified page does not exist (<a href=\"CreatePage.aspx?Page=" + pageInfo.RelativePath + "\">Create it</a>).");
                DisableAll();
                return;
            } catch (InvalidDirectoryException) {
                (Master as Dreadnought_Master).Message("You are not allowed to load a page from the directory '" + pageInfo.RelativeDirectory + "'.");
                DisableAll();
                return;
            } catch {
                (Master as Dreadnought_Master).Message("An unexpected error occurred. Please make sure you have sufficient user rights.");
                DisableAll();
                return;
            }

            if (!IsPostBack) {
                LoadContentPlaceholders();
                LoadText();
            }
        }
开发者ID:BackupTheBerlios,项目名称:dreadnought-svn,代码行数:30,代码来源:EditPage.aspx.cs

示例2: InitList

 /// <summary>
 /// 加载列表
 /// </summary>
 private void InitList()
 {
     Id = Utils.GetQueryStringValue("Id");
     int CurrencyPage = Utils.GetInt(Utils.GetQueryStringValue("Page"));
     if (CurrencyPage == 0)
         CurrencyPage = 1;
     PageInfo pi = new PageInfo();
     pi.PageIndex = CurrencyPage;
     pi.PageSize = 4;
     pi.AddCondition<HotspotHotelDTO>(o => o.publishtarget, Target, QueryMethod.Equal);
     pi.AddCondition<HotspotHotelDTO>(o => o.is_valid, 1, QueryMethod.Equal);
     //Response.Write(pi.ToSqlCondition());
     pi.OrderBy.Add("order_id", OrderByType.Asc);
     var list = BHotspot.GetHotelsList(pi);
     if (list != null)
     {
         this.rptList.DataSource = list;
         this.rptList.DataBind();
         if (!String.IsNullOrEmpty(Id))
         {
             InitRoomInfo(Id);
         }
         else
         {
             Id = list[0].hotspot_id;
             InitRoomInfo(Id);
         }
     }
 }
开发者ID:jslpower,项目名称:jingqu,代码行数:32,代码来源:travel_hotel.aspx.cs

示例3: Constructor_SetsNavigationMode

        public void Constructor_SetsNavigationMode()
        {
            PageInfo navigationEntry = new PageInfo("SamplePage", null);
            PageNavigationEventArgs eventArgs = new PageNavigationEventArgs(navigationEntry, PageNavigationMode.Forward);

            Assert.Equal(PageNavigationMode.Forward, eventArgs.NavigationMode);
        }
开发者ID:deepakpal9046,项目名称:Okra.Core,代码行数:7,代码来源:PageNavigationEventArgsFixture.cs

示例4: btnCreate_Click

        protected void btnCreate_Click(object sender, EventArgs e)
        {
            if (!IsValid) {
                (Master as Dreadnought_Master).Message("Please make sure the form is valid.");
                return;
            }

            PageInfo pageInfo = new PageInfo(txtPage.Text);

            if (pageInfo.Exists) {
                (Master as Dreadnought_Master).Message("This page already exists (<a href=\"EditPage.aspx?Page=" + pageInfo.RelativePath + "\">Edit it</a>).");
                return;
            }

            try {
                pageInfo.Save();
            } catch (Dreadnought.InvalidDirectoryException) {
                (Master as Dreadnought_Master).Message("You cannot create a page in the directory '" + pageInfo.RelativeDirectory + "'.");
                return;
            } catch {
                (Master as Dreadnought_Master).Message("An unexpected error occurred. Please make sure you have sufficent user rights.");
                return;
            }

            if (chkRedirect.Checked)
                Response.Redirect("EditPage.aspx?Page=" + pageInfo.RelativePath);
        }
开发者ID:BackupTheBerlios,项目名称:dreadnought-svn,代码行数:27,代码来源:CreatePage.aspx.cs

示例5: AddRedirection

        /// <summary>
        /// Adds a new Redirection.
        /// </summary>
        /// <param name="source">The source Page.</param>
        /// <param name="destination">The destination Page.</param>
        /// <returns>True if the Redirection is added, false otherwise.</returns>
        /// <remarks>The method prevents circular and multi-level redirection.</remarks>
        public static void AddRedirection(PageInfo source, PageInfo destination)
        {
            if(source == null) throw new ArgumentNullException("source");
            if(destination == null) throw new ArgumentNullException("destination");

            Cache.Provider.AddRedirection(source.FullName, destination.FullName);
        }
开发者ID:mono,项目名称:ScrewTurnWiki,代码行数:14,代码来源:Redirections.cs

示例6: InitTalkCount

 /// <summary>
 /// 加载评论数
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 protected void InitTalkCount(object sender, RepeaterItemEventArgs e)
 {
     if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem)
     {
         Repeater rptTalkList = (Repeater)e.Item.FindControl("rptTalkList");
         var Id = ((TywphotoalbumDTO)e.Item.DataItem).id;
         Literal ltrCollectCount = (Literal)e.Item.FindControl("ltrCollectCount");
         ltrCollectCount.Text = BMycollect.Count(Id);
         Literal ltrTalkCount = (Literal)e.Item.FindControl("ltrTalkCount");
         ltrTalkCount.Text = BComment.Count(Id,评论类型.光影);
         #region 评论列表
         PageInfo pi = new PageInfo();
         pi.PageIndex = 1;
         pi.PageSize = 10;
         pi.AddCondition<TywcommentDTO>(o => o.datasource, BasePage.Target, QueryMethod.Equal);
         pi.AddCondition<TywcommentDTO>(o => o.objecttype, (int)Adpost.YCH.BLL.评论类型.光影, QueryMethod.Equal);
         pi.AddCondition<TywcommentDTO>(o => o.objectid, Id, QueryMethod.Equal);
         pi.AddCondition<TywcommentDTO>(o => o.replyid, "0", QueryMethod.Equal);
         pi.OrderBy.Add("commenttime", OrderByType.Desc);
         var list = BComment.GetList(pi);
         if (list != null)
         {
             rptTalkList.DataSource = list;
             rptTalkList.DataBind();
         }
         #endregion
     }
 }
开发者ID:jslpower,项目名称:jingqu,代码行数:33,代码来源:share_shadow.aspx.cs

示例7: GetAFreePage

        private PageInfo GetAFreePage(uint size)
        {
            uint neededBlocks = BlocksForSize(size);

            if (InfoTable.Any(page => PageIsUnusedAndBigEnough(page, neededBlocks)))
            {
                return InfoTable.First(page => PageIsUnusedAndBigEnough(page, neededBlocks));
            }
            else
            {
                PageInfo lastPage = InfoTable.Last();
                uint nextAvailableAddress = lastPage.RealAddress + lastPage.Size;

                PageInfo newPage = new PageInfo()
                    {
                        RealAddress = nextAvailableAddress,
                        Size = neededBlocks * BLOCKSIZE,
                        Used = true
                    };

                InfoTable.Add(newPage);

                return newPage;
            }
        }
开发者ID:docblades,项目名称:NewOpSys,代码行数:25,代码来源:PageTable.cs

示例8: GetCommentsByArticleId

        /// <summary>
        /// 取得一个文章的评论
        /// </summary>
        /// <param name="articleId"></param>
        /// <param name="pageIndex"></param>
        /// <returns></returns>
        public PageInfo<Comment> GetCommentsByArticleId(int articleId, int pageIndex)
        {
            //缓存加载
            PageInfo<Comment> page = null;

            page = new PageInfo<Comment>();
            int userId = _sessionManager.User == null ? 0 : _sessionManager.User.UserId;
            int pageSize = int.Parse(_settiongService.GetSetting("CommentPageSize"));
            page.PageSize = pageSize;

            page.TotalItem = (int)_commentRepository.Single(query => query.Where(
                c => c.Article.ArticleId == articleId && (c.Parent.CommentId == 0 || c.Parent == null) && ((c.Status == CommentStatus.Open) || (c.User.UserId == userId && c.Status != CommentStatus.Delete))
                ).Count()
            );

            pageIndex = pageIndex > page.TotalPage ? page.TotalPage : pageIndex;
			pageIndex = pageIndex <= 0 ? 1 : pageIndex;
            page.PageItems = _commentRepository.Find(query => query.Where(
                c => c.Article.ArticleId == articleId && (c.Parent.CommentId == 0 || c.Parent == null) && ((c.Status == CommentStatus.Open) || (c.User.UserId == userId && c.Status != CommentStatus.Delete))
                ).OrderBy(c => c.CreateDate).Skip((pageIndex - 1) * pageSize).Take(pageSize)
            );


            page.PageIndex = pageIndex;
            return page;
        }
开发者ID:miandai,项目名称:.Net-MVC-Blog,代码行数:32,代码来源:CommentService.cs

示例9: InitList

 /// <summary>
 /// 加载列表
 /// </summary>
 private void InitList()
 {
     CurrencyPage = Utils.GetInt(Utils.GetQueryStringValue("Page"));
     if (CurrencyPage == 0)
         CurrencyPage = 1;
     string Keyword = Utils.GetQueryStringValue("KeyWord");
     PageInfo pi = new PageInfo();
     pi.PageIndex = CurrencyPage;
     pi.PageSize = PageSize;
     pi.AddCondition<CptoutactivitiesDTO>(o => o.publishtarget, Target, QueryMethod.Equal);
     pi.AddCondition<CptoutactivitiesDTO>(o => o.is_valid, 1, QueryMethod.Equal);
     //有效活动
     DateTime cDate = DateTime.Now;
     pi.AddCondition<CptoutactivitiesDTO>(o => o.act_startdate, cDate, QueryMethod.LessThanOrEqual);
     pi.AddCondition<CptoutactivitiesDTO>(o => o.act_enddate, cDate, QueryMethod.GreaterThan);
     if (!String.IsNullOrWhiteSpace(Keyword))
     {
         pi.AddCondition<CptoutactivitiesDTO>(o => o.act_name, Keyword, QueryMethod.Like);
     }
     pi.OrderBy.Add("create_date", OrderByType.Desc);
     var list = BActivities.GetList(pi, ref TotalRows);
     if (list != null)
     {
         this.rptList.DataSource = list;
         this.rptList.DataBind();
     }
 }
开发者ID:jslpower,项目名称:jingqu,代码行数:30,代码来源:bandao-huodong.aspx.cs

示例10: InitScenicList

 /// <summary>
 /// 加载列表
 /// </summary>
 private void InitScenicList()
 {
     PageInfo pi = new PageInfo();
     pi.PageIndex = 1;
     pi.PageSize = int.MaxValue;
     pi.AddCondition<HotspotScenicsDTO>(o => o.publishtarget, Target, QueryMethod.Equal);
     pi.AddCondition<HotspotScenicsDTO>(o => o.is_valid, 1, QueryMethod.Equal);
     //Response.Write(pi.ToSqlCondition());
     var list = BHotspot.GetScenicsList(pi);
     if (list != null)
     {
         System.Text.StringBuilder tmpStr = new System.Text.StringBuilder();
         tmpStr.Append("<li>");
         for (int i = 0; i < list.Count(); i++)
         {
             if ((i + 1) % 2 == 0)
             {
                 tmpStr.Append("<div class=\"list_div right\"><img class=\"list_img\" src=\"" + Common.NoPhotoDefault(list[i].coverphoto) + "\"><h1>" + list[i].hotspot_name + "</h1><p>" + list[i].tourtime + "</p><a href=\"javascript:void(0)\" ID=\"" + list[i].id + "\" EID=\"" + list[i].hotspot_id + "\" class=\"jingdianAdd\">&nbsp;</a></div>");
             }
             else
             {
                 tmpStr.Append("<div class=\"list_div left\"><img class=\"list_img\" src=\"" + Common.NoPhotoDefault(list[i].coverphoto) + "\"><h1>" + list[i].hotspot_name + "</h1><p>" + list[i].tourtime + "</p><a href=\"javascript:void(0)\" ID=\"" + list[i].id + "\" EID=\"" + list[i].hotspot_id + "\" class=\"jingdianAdd\">&nbsp;</a></div>");
             }
             
             if ((i+1) % 2 == 0) { tmpStr.Append("</li><li>"); }
         }
         tmpStr.Append("</li>");
         this.ltrJD.Text = tmpStr.ToString();
     }
 }
开发者ID:jslpower,项目名称:jingqu,代码行数:33,代码来源:trip_custom.aspx.cs

示例11: ExtractFromResponse

        private PageInfo ExtractFromResponse(HttpWebResponse response)
        {
            var info = new PageInfo();

            using (var responseStream = response.GetResponseStream())
            {
                var htmlDocument = new HtmlDocument();
                htmlDocument.Load(responseStream);
                htmlDocument.OptionFixNestedTags = true;

                var quote = htmlDocument.DocumentNode
                                        .SelectSingleNode("//body")
                                        .SelectNodes("//p").Where(a => a.Attributes.Any(x => x.Name == "class" && x.Value == "qt"))
                                        .SingleOrDefault();

                var title = htmlDocument.DocumentNode
                                        .SelectSingleNode("//title");

                //Quote might not be found, bash.org doesn't have a 404 page
                if (quote == null || title == null)
                {
                    return null;
                }

                //Strip out any HTML that isn't defined in the WhiteList
                SanitizeHtml(quote);

                info.Quote = quote.InnerHtml;
                info.PageURL = response.ResponseUri.AbsoluteUri;
                info.QuoteNumber = title.InnerHtml;
            }

            return info;
        }
开发者ID:paulduran,项目名称:blaze,代码行数:34,代码来源:BashQDBContentProvider.cs

示例12: BadReportList

        public ActionResult BadReportList()
        {
            int queryTime = WebUtil.GetFormValue<int>("QueryTime", 0);
            int pageIndex = WebUtil.GetFormValue<int>("pageIndex", 0);
            int pageSize = WebUtil.GetFormValue<int>("pageSize", 0);

            string storageNum = this.DefaultStore;

            BadProvider provider = new BadProvider();
            BadReportEntity entity = new BadReportEntity();
            PageInfo pageInfo = new PageInfo() { PageIndex = pageIndex, PageSize = pageSize };
            if (queryTime > 0)
            {
                entity.Where("CreateTime", ECondition.Between, DateTime.Now.AddDays(-queryTime), DateTime.Now);
            }

            if (storageNum.IsNotNull())
            {
                entity.Where("StorageNum", ECondition.Eth, storageNum);
            }

            entity.And(a => a.StorageNum == this.DefaultStore);

            List<BadReportEntity> listResult = provider.GetList(entity, ref pageInfo, storageNum);
            listResult = listResult == null ? new List<BadReportEntity>() : listResult;
            string json = ConvertJson.ListToJson<BadReportEntity>(listResult, "List");
            this.ReturnJson.AddProperty("Data", new JsonObject(json));
            this.ReturnJson.AddProperty("RowCount", pageInfo.RowCount);
            return Content(this.ReturnJson.ToString());
        }
开发者ID:ZhangHanLong,项目名称:gitwms,代码行数:30,代码来源:ReportAjaxController.cs

示例13: InitList

 /// <summary>
 /// 加载列表
 /// </summary>
 private void InitList()
 {
     CurrencyPage = Utils.GetInt(Utils.GetQueryStringValue("Page"));
     if (CurrencyPage == 0)
         CurrencyPage = 1;
     string Keyword = Utils.GetQueryStringValue("KeyWord");
     PageInfo pi = new PageInfo();
     pi.PageIndex = CurrencyPage;
     pi.PageSize = PageSize;
     int infoType = (int)资讯类别.新闻资讯;
     pi.AddCondition<TywinformationDTO>(o => o.publishtarget, Target, QueryMethod.Equal);
     pi.AddCondition<TywinformationDTO>(o => o.info_type, infoType, QueryMethod.Equal);
     pi.AddCondition<TywinformationDTO>(o => o.is_valid, 1, QueryMethod.Equal);
     if (!String.IsNullOrWhiteSpace(Keyword))
     {
         pi.AddCondition<TywinformationDTO>(o => o.title, Keyword, QueryMethod.Like);
     }
     //Response.Write(pi.ToSqlCondition());
     pi.OrderBy.Add("create_date", OrderByType.Desc);
     var list = BInfomation.GetList(pi, ref TotalRows);
     if (list != null) {
         this.rptList.DataSource = list;
         this.rptList.DataBind();
     }
 }
开发者ID:jslpower,项目名称:jingqu,代码行数:28,代码来源:news_information.aspx.cs

示例14: PageActivityEventArgs

 /// <summary>
 /// Initializes a new instance of the <see cref="T:PageActivityEventArgs" /> class.
 /// </summary>
 /// <param name="page">The page the activity refers to.</param>
 /// <param name="pageOldName">The old name of the renamed page, or <c>null</c>.</param>
 /// <param name="author">The author of the activity, if available, <c>null</c> otherwise.</param>
 /// <param name="activity">The activity.</param>
 public PageActivityEventArgs(PageInfo page, string pageOldName, string author, PageActivity activity)
 {
     this.page = page;
     this.pageOldName = pageOldName;
     this.author = author;
     this.activity = activity;
 }
开发者ID:mono,项目名称:ScrewTurnWiki,代码行数:14,代码来源:PageActivityEventArgs.cs

示例15: InitList

 /// <summary>
 /// 加载列表
 /// </summary>
 private void InitList()
 {
     int typeId = Utils.GetInt(Utils.GetQueryStringValue("Type"));
     CurrencyPage = Utils.GetInt(Utils.GetQueryStringValue("Page"));
     if (CurrencyPage == 0)
         CurrencyPage = 1;
     string Keyword = Utils.GetQueryStringValue("KeyWord");
     PageInfo pi = new PageInfo();
     pi.PageIndex = CurrencyPage;
     pi.PageSize = PageSize;
     //pi.AddCondition<ViewOrderDTO>(o => o.publishtarget, Target, QueryMethod.Equal);
     pi.AddCondition<ViewOrderDTO>(o => o.is_valid, 1, QueryMethod.Equal);
     if (typeId != 0)
     {
         pi.AddCondition<ViewOrderDTO>(o => o.ordertype, typeId, QueryMethod.Equal);
     }
     else
     {
         pi.AddCondition<ViewOrderDTO>(o => o.ordertype, (int)订单类型.酒店订单, QueryMethod.Equal);
     }
     var model = LoginCheck();
     pi.AddCondition<ViewOrderDTO>(o => o.member_id, model.id, QueryMethod.Equal);
     if (!String.IsNullOrWhiteSpace(Keyword))
     {
         pi.AddCondition<ViewOrderDTO>(o => o.productname, Keyword, QueryMethod.Like);
     }
     pi.OrderBy.Add("create_date", OrderByType.Desc);
     var list = BOrder.GetViewList(pi, ref TotalRows);
     if (list != null)
     {
         this.rptList.DataSource = list;
         this.rptList.DataBind();
     }
 }
开发者ID:jslpower,项目名称:jingqu,代码行数:37,代码来源:user-dd2.aspx.cs


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