BlogEngine.Web/archive.aspx.cs

(开头部分) 6KB

这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。

#region Using

using System;
using System.Web;
using System.Collections.Generic;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.HtmlControls;
using BlogEngine.Core;

#endregion

public partial class archive : BlogEngine.Core.Web.Controls.BlogBasePage
{
	/// <summary>
	/// Handles the Load event of the Page control.
	/// </summary>
	/// <param name="sender">The source of the event.</param>
	/// <param name="e">The <see cref="System.EventArgs"/> instance containing the event data.</param>
  protected void Page_Load(object sender, EventArgs e)
  {
    if (!IsPostBack && !IsCallback)
    {
			CreateMenu();
      CreateArchive();
      AddTotals();
    }

    Page.Title = Server.HtmlEncode(Resources.labels.archive);
    base.AddMetaTag("description", Resources.labels.archive + " | " + BlogSettings.Instance.Name);
  }

	/// <summary>
	/// Creates the category top menu.
	/// </summary>
  private void CreateMenu()
  {
    foreach (Category cat in Category.Categories)
    {
			AddCategoryToMenu(cat.Title);
    }
  }

	private void AddCategoryToMenu(string title)
	{
		HtmlAnchor a = new HtmlAnchor();
		a.InnerHtml = Server.HtmlEncode(title);
		a.HRef = "#" + Utils.RemoveIllegalCharacters(title);
		a.Attributes.Add("rel", "directory");

		HtmlGenericControl li = new HtmlGenericControl("li");
		li.Controls.Add(a);
		ulMenu.Controls.Add(li);
	}

	/// <summary>
	/// Sorts the categories.
	/// </summary>
	/// <param name="categories">The categories.</param>
  private SortedDictionary<string, Guid> SortCategories(Dictionary<Guid, string> categories)
后面还有 155 行代码,解锁后查看完整代码

24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明

AI 解读 AI

登录后可用,每次 10 算力,解读结果公开显示在下面。

还没有人解读过这个文件。