MarkItUp.SingleUserBlog/UI/PathControl.cs
(开头部分) 2KB这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。
using System;
using System.Data;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Collections;
namespace MarkItUp.SingleUserBlog.UI {
public enum TagType : short {
Script,
Link
}
public class PathControl : Control, IAttributeAccessor {
public PathControl() { }
public string Path {
get { return ViewState["Path"] as string; }
set { ViewState["Path"] = value; }
}
public TagType TagType {
get { return (ViewState["TagType"] == null) ? TagType.Link : (TagType)ViewState["TagType"]; }
set { ViewState["TagType"] = value; }
}
Hashtable attribs = new Hashtable();
protected override void Render(HtmlTextWriter writer) {
base.Render(writer);
RenderStartTag(writer);
foreach (string key in attribs.Keys) {
writer.WriteAttribute(key, (string)attribs[key]);
}
RenderEndTag(writer);
writer.Write(Environment.NewLine);
}
protected virtual void RenderStartTag(HtmlTextWriter writer) {
if (TagType == TagType.Script) {
writer.Write("<script src=\"" + ResolveClientUrl(Path) + "\"");
} else {
writer.Write("<link href=\"" + ResolveClientUrl(Path) + "\"");
}
}
后面还有 18 行代码,解锁后查看完整代码
24 小时内免费解锁 3 个项目,之后 1 积分/个。 规则说明
AI 解读
登录后可用,每次 10 积分,解读结果公开显示在下面。
还没有人解读过这个文件。
