當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。