C# 클래스 Subtext.Framework.Format.UrlFormats

Default Implemenation of UrlFormats
파일 보기 프로젝트 열기: ayende/Subtext 1 사용 예제들

보호된 프로퍼티들

프로퍼티 타입 설명
fullyQualifiedUrl string

공개 메소드들

메소드 설명
AdminUrl ( string Page ) : string
AggBugkUrl ( int EntryID ) : string
ArticleCategoryUrl ( string categoryName, int categoryID ) : string
ArticleUrl ( Entry entry ) : string
CommentApiUrl ( int entryId ) : string
CommentRssUrl ( int entryId ) : string
DateFromUrl ( string url ) : System.DateTime

Returns a DateTime instance parsed from the url.

DayUrl ( System.DateTime dt ) : string
EntryFullyQualifiedUrl ( System.DateTime entryDate, string entryID ) : string
EntryFullyQualifiedUrl ( System.DateTime entryDate, string entryName, int entryId ) : string
EntryFullyQualifiedUrl ( Entry entry ) : string
EntryUrl ( Entry entry ) : string

Returns a relative URL to the entry.

FeedbackFullyQualifiedUrl ( int parentId, string parentEntryName, System.DateTime parentCreateDate, FeedbackItem feedback ) : Uri

Returns the fully URL to the specified feedback item.

FeedbackUrl ( int parentId, string parentEntryName, System.DateTime parentCreateDate, FeedbackItem feedback ) : string

Returns the URL to the specified feedback item.

GalleryUrl ( string category, int GalleryID ) : string
GetBlogSubfolderFromRequest ( string rawUrl, string applicationPath ) : string

Parses out the subfolder of the blog from the requested URL. It simply searches for the first "folder" after the host and Request.ApplicationPath.

For example, if a blog is hosted at the virtual directory http://localhost/Subtext.Web/ and request is made for http://localhost/Subtext.Web/, the subfolder name is "" (empty string). Howver, a request for http://localhost/Subtext.Web/MyBlog/ would return "MyBlog" as the subfolder.

Likewise, if a blog is hosted at http://localhost/, a request for http://localhost/MyBlog/ would return "MyBlog" as the subfolder.

GetEditLink ( Entry entry ) : string

Builds the HyperLink.NavigateUrl for an EditPost Link by determining the current Subfolder and adding it to the URL if necessary.

GetFeedbackEditLink ( FeedbackItem feedback ) : string
GetHostFromExternalUrl ( string url ) : string

Parses out the host from an external URL.

GetImageFullUrl ( string imageUrl ) : string

Get the fully qualified url for an image for a given url to the image. The given url could be fully qualified, or some type of local url.

GetPostIDFromUrl ( string uri ) : int

Parses out the post ID from URL.

GetRequestedFileName ( string uri ) : string

Gets the name of the requested file.

GetUriReferrerSafe ( HttpRequest request ) : Uri

From Jason Block @ http://www.angrycoder.com/article.aspx?cid=5&y=2003&m=4&d=15 Basically, it's [Request.UrlReferrer] doing a lazy initialization of its internal _referrer field, which is a Uri-type class. That is, it's not created until it's needed. The point is that there are a couple of spots where the UriFormatException could leak through. One is in the call to GetKnownRequestHeader(). _wr is a field of type HttpWorkerRequest. 36 is the value of the HeaderReferer constant - since that's being blocked in this case, it may cause that exception to occur. However, HttpWorkerRequest is an abstract class, and it took a trip to the debugger to find out that _wr is set to a System.Web.Hosting.ISAPIWorkerRequestOutOfProc object. This descends from System.Web.Hosting.ISAPIWorkerRequest, and its implementation of GetKnownRequestHeader() didn't seem to be the source of the problem.

ImageUrl ( string category, int ImageID ) : string
IsInDirectory ( String rootFolderName ) : bool

Determines whether the current request is in the specified directory.

IsInSpecialDirectory ( string folderName ) : bool

Determines whether the current request is a request within a special directory.

MonthUrl ( System.DateTime dt ) : string
PostCategoryUrl ( string categoryName, int categoryID ) : string
ResolveLinks ( string body ) : string
ShortenUrl ( string url, int max ) : string
StripHostFromUrl ( string url ) : string

Return the url with the http://host stripped off the front. The given url may or maynot have the http://host on it.

StripSurroundingSlashes ( string target ) : string

Strips the surrounding slashes from the specified string.

TrackBackUrl ( int entryId ) : string
UrlFormats ( Uri fullyQualifiedUrl ) : System
YearUrl ( System.DateTime dt ) : string

보호된 메소드들

메소드 설명
GetFullyQualifiedUrl ( string formatString ) : string

Returns a fully qualified Url using the specified format string.

GetUrl ( string formatString ) : string

Returns a fully qualified Url using the specified format string.

비공개 메소드들

메소드 설명
EntryUrl ( int entryId, string entryName, System.DateTime entryDate ) : string

메소드 상세

AdminUrl() 공개 메소드

public AdminUrl ( string Page ) : string
Page string
리턴 string

AggBugkUrl() 공개 메소드

public AggBugkUrl ( int EntryID ) : string
EntryID int
리턴 string

ArticleCategoryUrl() 공개 메소드

public ArticleCategoryUrl ( string categoryName, int categoryID ) : string
categoryName string
categoryID int
리턴 string

ArticleUrl() 공개 메소드

public ArticleUrl ( Entry entry ) : string
entry Subtext.Framework.Components.Entry
리턴 string

CommentApiUrl() 공개 메소드

public CommentApiUrl ( int entryId ) : string
entryId int
리턴 string

CommentRssUrl() 공개 메소드

public CommentRssUrl ( int entryId ) : string
entryId int
리턴 string

DateFromUrl() 공개 정적인 메소드

Returns a DateTime instance parsed from the url.
public static DateFromUrl ( string url ) : System.DateTime
url string URL.
리턴 System.DateTime

DayUrl() 공개 메소드

public DayUrl ( System.DateTime dt ) : string
dt System.DateTime
리턴 string

EntryFullyQualifiedUrl() 공개 메소드

public EntryFullyQualifiedUrl ( System.DateTime entryDate, string entryID ) : string
entryDate System.DateTime
entryID string
리턴 string

EntryFullyQualifiedUrl() 공개 메소드

public EntryFullyQualifiedUrl ( System.DateTime entryDate, string entryName, int entryId ) : string
entryDate System.DateTime
entryName string
entryId int
리턴 string

EntryFullyQualifiedUrl() 공개 메소드

public EntryFullyQualifiedUrl ( Entry entry ) : string
entry Subtext.Framework.Components.Entry
리턴 string

EntryUrl() 공개 메소드

Returns a relative URL to the entry.
public EntryUrl ( Entry entry ) : string
entry Subtext.Framework.Components.Entry The entry.
리턴 string

FeedbackFullyQualifiedUrl() 공개 메소드

Returns the fully URL to the specified feedback item.
public FeedbackFullyQualifiedUrl ( int parentId, string parentEntryName, System.DateTime parentCreateDate, FeedbackItem feedback ) : Uri
parentId int The id of the parent entry.
parentEntryName string If exists.
parentCreateDate System.DateTime
feedback Subtext.Framework.Components.FeedbackItem The feedback.
리턴 System.Uri

FeedbackUrl() 공개 메소드

Returns the URL to the specified feedback item.
public FeedbackUrl ( int parentId, string parentEntryName, System.DateTime parentCreateDate, FeedbackItem feedback ) : string
parentId int The id of the parent entry.
parentEntryName string If exists.
parentCreateDate System.DateTime
feedback Subtext.Framework.Components.FeedbackItem The feedback.
리턴 string

GalleryUrl() 공개 메소드

public GalleryUrl ( string category, int GalleryID ) : string
category string
GalleryID int
리턴 string

GetBlogSubfolderFromRequest() 공개 정적인 메소드

Parses out the subfolder of the blog from the requested URL. It simply searches for the first "folder" after the host and Request.ApplicationPath.

For example, if a blog is hosted at the virtual directory http://localhost/Subtext.Web/ and request is made for http://localhost/Subtext.Web/, the subfolder name is "" (empty string). Howver, a request for http://localhost/Subtext.Web/MyBlog/ would return "MyBlog" as the subfolder.

Likewise, if a blog is hosted at http://localhost/, a request for http://localhost/MyBlog/ would return "MyBlog" as the subfolder.

public static GetBlogSubfolderFromRequest ( string rawUrl, string applicationPath ) : string
rawUrl string The raw url.
applicationPath string The virtual application name as found in the Request.ApplicationName property.
리턴 string

GetEditLink() 공개 정적인 메소드

Builds the HyperLink.NavigateUrl for an EditPost Link by determining the current Subfolder and adding it to the URL if necessary.
public static GetEditLink ( Entry entry ) : string
entry Subtext.Framework.Components.Entry The entry to be edited
리턴 string

GetFeedbackEditLink() 공개 정적인 메소드

public static GetFeedbackEditLink ( FeedbackItem feedback ) : string
feedback Subtext.Framework.Components.FeedbackItem
리턴 string

GetFullyQualifiedUrl() 보호된 메소드

Returns a fully qualified Url using the specified format string.
protected GetFullyQualifiedUrl ( string formatString ) : string
formatString string The pattern.
리턴 string

GetHostFromExternalUrl() 공개 정적인 메소드

Parses out the host from an external URL.
public static GetHostFromExternalUrl ( string url ) : string
url string The URL.
리턴 string

GetImageFullUrl() 공개 정적인 메소드

Get the fully qualified url for an image for a given url to the image. The given url could be fully qualified, or some type of local url.
public static GetImageFullUrl ( string imageUrl ) : string
imageUrl string url to an image
리턴 string

GetPostIDFromUrl() 공개 정적인 메소드

Parses out the post ID from URL.
public static GetPostIDFromUrl ( string uri ) : int
uri string The URI.
리턴 int

GetRequestedFileName() 공개 정적인 메소드

Gets the name of the requested file.
public static GetRequestedFileName ( string uri ) : string
uri string The URI.
리턴 string

GetUriReferrerSafe() 공개 정적인 메소드

From Jason Block @ http://www.angrycoder.com/article.aspx?cid=5&y=2003&m=4&d=15 Basically, it's [Request.UrlReferrer] doing a lazy initialization of its internal _referrer field, which is a Uri-type class. That is, it's not created until it's needed. The point is that there are a couple of spots where the UriFormatException could leak through. One is in the call to GetKnownRequestHeader(). _wr is a field of type HttpWorkerRequest. 36 is the value of the HeaderReferer constant - since that's being blocked in this case, it may cause that exception to occur. However, HttpWorkerRequest is an abstract class, and it took a trip to the debugger to find out that _wr is set to a System.Web.Hosting.ISAPIWorkerRequestOutOfProc object. This descends from System.Web.Hosting.ISAPIWorkerRequest, and its implementation of GetKnownRequestHeader() didn't seem to be the source of the problem.
public static GetUriReferrerSafe ( HttpRequest request ) : Uri
request System.Web.HttpRequest
리턴 System.Uri

GetUrl() 보호된 메소드

Returns a fully qualified Url using the specified format string.
protected GetUrl ( string formatString ) : string
formatString string The pattern.
리턴 string

ImageUrl() 공개 메소드

public ImageUrl ( string category, int ImageID ) : string
category string
ImageID int
리턴 string

IsInDirectory() 공개 정적인 메소드

Determines whether the current request is in the specified directory.
public static IsInDirectory ( String rootFolderName ) : bool
rootFolderName String Name of the root folder.
리턴 bool

IsInSpecialDirectory() 공개 정적인 메소드

Determines whether the current request is a request within a special directory.
public static IsInSpecialDirectory ( string folderName ) : bool
folderName string Name of the folder.
리턴 bool

MonthUrl() 공개 메소드

public MonthUrl ( System.DateTime dt ) : string
dt System.DateTime
리턴 string

PostCategoryUrl() 공개 메소드

public PostCategoryUrl ( string categoryName, int categoryID ) : string
categoryName string
categoryID int
리턴 string

ResolveLinks() 공개 정적인 메소드

public static ResolveLinks ( string body ) : string
body string
리턴 string

ShortenUrl() 공개 정적인 메소드

public static ShortenUrl ( string url, int max ) : string
url string
max int
리턴 string

StripHostFromUrl() 공개 정적인 메소드

Return the url with the http://host stripped off the front. The given url may or maynot have the http://host on it.
public static StripHostFromUrl ( string url ) : string
url string
리턴 string

StripSurroundingSlashes() 공개 정적인 메소드

Strips the surrounding slashes from the specified string.
public static StripSurroundingSlashes ( string target ) : string
target string The target.
리턴 string

TrackBackUrl() 공개 메소드

public TrackBackUrl ( int entryId ) : string
entryId int
리턴 string

UrlFormats() 공개 메소드

public UrlFormats ( Uri fullyQualifiedUrl ) : System
fullyQualifiedUrl System.Uri
리턴 System

YearUrl() 공개 메소드

public YearUrl ( System.DateTime dt ) : string
dt System.DateTime
리턴 string

프로퍼티 상세

fullyQualifiedUrl 보호되어 있는 프로퍼티

protected string fullyQualifiedUrl
리턴 string