📄 trackbackmarkup.cs
字号:
//------------------------------------------------------------------------------
// <copyright company="Telligent Systems">
// Copyright (c) Telligent Systems Corporation. All rights reserved.
// </copyright>
//------------------------------------------------------------------------------
using System;
using System.Web.UI;
using CommunityServer.Components;
namespace CommunityServer.Blogs.Controls
{
/// <summary>
/// Summary description for TrackbackMarkUp.
/// </summary>
public class TrackbackMarkUp : Control
{
static string tag = Environment.NewLine + "<!--" + Environment.NewLine +
"<rdf:RDF xmlns:rdf=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#\"" + Environment.NewLine +
"xmlns:dc=\"http://purl.org/dc/elements/1.1/\"" + "\n" +
"xmlns:trackback=\"http://madskills.com/public/xml/rss/module/trackback/\">" + Environment.NewLine +
"<rdf:Description" + Environment.NewLine +
"rdf:about=\"{0}\"" + Environment.NewLine +
"dc:identifier=\"{0}\"" + Environment.NewLine +
"dc:title=\"{1}\"" + Environment.NewLine +
"trackback:ping=\"{2}\" />" + Environment.NewLine +
"</rdf:RDF>" + Environment.NewLine +
"-->" + Environment.NewLine;
/// <summary>
/// Renders the RDF trackback markup
/// </summary>
public TrackbackMarkUp()
{
}
protected override void Render(HtmlTextWriter writer)
{
if(IsValid)
{
string baseUrl = Globals.HostPath(Context.Request.Url);
writer.WriteLine(tag,baseUrl+PermaLink,Title,baseUrl+PingUrl);
}
}
private bool IsValid
{
get
{
return !Globals.IsNullorEmpty(Title) && !Globals.IsNullorEmpty(PermaLink) && !Globals.IsNullorEmpty(PingUrl);
}
}
private string _title;
/// <summary>
/// Property Title (string)
/// </summary>
public string Title
{
get { return this._title; }
set { this._title = value; }
}
private string _permaLink;
/// <summary>
/// Property PermaLink (string)
/// </summary>
public string PermaLink
{
get { return this._permaLink; }
set { this._permaLink = value; }
}
private string _pingUrl;
/// <summary>
/// Property PingUrl (string)
/// </summary>
public string PingUrl
{
get { return this._pingUrl; }
set { this._pingUrl = value; }
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -