C# 클래스 ScrewTurn.Wiki.Tools

Contains useful Tools.
파일 보기 프로젝트 열기: mono/ScrewTurnWiki 1 사용 예제들

공개 메소드들

메소드 설명
BytesToString ( long bytes ) : string

Converts a byte number into a string, formatted using KB, MB or GB.

ComputeSecurityHash ( string username, string email, System.DateTime dateTime ) : string

Computes the Hash of a Username, mixing it with other data, in order to avoid illegal Account activations.

DetectCurrentFullName ( ) : string

Detects the full name of the current page using the Page and NS parameters in the query string.

DetectCurrentNamespace ( ) : string

Detects the name of the current namespace using the NS parameter in the query string.

DetectCurrentNamespaceInfo ( ) : NamespaceInfo

Detects the correct T:NamespaceInfo object associated to the current namespace using the NS parameter in the query string.

DetectCurrentPageInfo ( bool loadDefault ) : System.PageInfo

Detects the correct T:PageInfo object associated to the current page using the Page and NS parameters in the query string.

DiskUsage ( string dir ) : long

Computes the Disk Space Usage of a directory.

EscapeString ( string input ) : string

Escapes bad characters in a string (pipes and \n).

ExtractDirectoryName ( string path ) : string

Extracts the directory name from a path used in the Files Storage Providers.

GenerateRandomPassword ( ) : string

Generates a random 10-char Password.

GetDirectoryName ( string filename ) : string

Gets the name of a file's directory.

GetIncludes ( string nspace ) : string

Gets all the included files for the HTML Head, such as CSS, JavaScript and Icon pluginAssemblies, for a namespace.

GetJavaScriptIncludes ( ) : string

Gets all the JavaScript files to include.

GetMessageIdForAnchor ( System.DateTime messageDateTime ) : string

Gets the message ID for HTML anchors.

GetUpdateStatus ( string url, string currentVersion, string &newVersion, string &newAssemblyUrl ) : UpdateStatus

Gets the update status of a component.

This method only works in Full Trust.

GetVersionString ( int version ) : string

Generates the standard 5-digit Page Version string.

HashDocumentNameForTemporaryIndex ( string value ) : uint

Computes the hash value of a string that is value across application instances and versions.

IsRightToLeftCulture ( ) : bool

Get the direction of the current culture.

ObfuscateText ( string input ) : string

Obfuscates text, replacing each character with its HTML escaped sequence, for example a becomes a.

RemoveHtmlMarkup ( string html ) : string

Removes all HTML tags from a text.

TimeSpanToString ( System.TimeSpan span ) : string

Converts a Time Span to string.

UnescapeString ( string input ) : string

Unescapes bad characters in a string (pipes and \n).

UrlDecode ( string input ) : string

Executes URL-decoding, replacing spaces as processed by UrlEncode.

UrlEncode ( string input ) : string

Executes URL-encoding, avoiding to use '+' for spaces.

비공개 메소드들

메소드 설명
UppercaseInitial ( string value ) : string

메소드 상세

BytesToString() 공개 정적인 메소드

Converts a byte number into a string, formatted using KB, MB or GB.
public static BytesToString ( long bytes ) : string
bytes long The # of bytes.
리턴 string

ComputeSecurityHash() 공개 정적인 메소드

Computes the Hash of a Username, mixing it with other data, in order to avoid illegal Account activations.
public static ComputeSecurityHash ( string username, string email, System.DateTime dateTime ) : string
username string The Username.
email string The email.
dateTime System.DateTime The date/time.
리턴 string

DetectCurrentFullName() 공개 정적인 메소드

Detects the full name of the current page using the Page and NS parameters in the query string.
public static DetectCurrentFullName ( ) : string
리턴 string

DetectCurrentNamespace() 공개 정적인 메소드

Detects the name of the current namespace using the NS parameter in the query string.
public static DetectCurrentNamespace ( ) : string
리턴 string

DetectCurrentNamespaceInfo() 공개 정적인 메소드

Detects the correct T:NamespaceInfo object associated to the current namespace using the NS parameter in the query string.
public static DetectCurrentNamespaceInfo ( ) : NamespaceInfo
리턴 NamespaceInfo

DetectCurrentPageInfo() 공개 정적인 메소드

Detects the correct T:PageInfo object associated to the current page using the Page and NS parameters in the query string.
public static DetectCurrentPageInfo ( bool loadDefault ) : System.PageInfo
loadDefault bool true to load the default page of the specified namespace when Page is not specified, false otherwise.
리턴 System.PageInfo

DiskUsage() 공개 정적인 메소드

Computes the Disk Space Usage of a directory.
public static DiskUsage ( string dir ) : long
dir string The directory.
리턴 long

EscapeString() 공개 정적인 메소드

Escapes bad characters in a string (pipes and \n).
public static EscapeString ( string input ) : string
input string The input string.
리턴 string

ExtractDirectoryName() 공개 정적인 메소드

Extracts the directory name from a path used in the Files Storage Providers.
public static ExtractDirectoryName ( string path ) : string
path string The path, for example '/folder/blah/'.
리턴 string

GenerateRandomPassword() 공개 정적인 메소드

Generates a random 10-char Password.
public static GenerateRandomPassword ( ) : string
리턴 string

GetDirectoryName() 공개 정적인 메소드

Gets the name of a file's directory.
public static GetDirectoryName ( string filename ) : string
filename string The filename.
리턴 string

GetIncludes() 공개 정적인 메소드

Gets all the included files for the HTML Head, such as CSS, JavaScript and Icon pluginAssemblies, for a namespace.
public static GetIncludes ( string nspace ) : string
nspace string The namespace (null for the root).
리턴 string

GetJavaScriptIncludes() 공개 정적인 메소드

Gets all the JavaScript files to include.
public static GetJavaScriptIncludes ( ) : string
리턴 string

GetMessageIdForAnchor() 공개 정적인 메소드

Gets the message ID for HTML anchors.
public static GetMessageIdForAnchor ( System.DateTime messageDateTime ) : string
messageDateTime System.DateTime The message date/time.
리턴 string

GetUpdateStatus() 공개 정적인 메소드

Gets the update status of a component.
This method only works in Full Trust.
public static GetUpdateStatus ( string url, string currentVersion, string &newVersion, string &newAssemblyUrl ) : UpdateStatus
url string The version file URL.
currentVersion string The current version.
newVersion string The new version, if any.
newAssemblyUrl string The URL of the new assembly, if applicable and available.
리턴 UpdateStatus

GetVersionString() 공개 정적인 메소드

Generates the standard 5-digit Page Version string.
public static GetVersionString ( int version ) : string
version int The Page version.
리턴 string

HashDocumentNameForTemporaryIndex() 공개 정적인 메소드

Computes the hash value of a string that is value across application instances and versions.
public static HashDocumentNameForTemporaryIndex ( string value ) : uint
value string The string to compute the hash of.
리턴 uint

IsRightToLeftCulture() 공개 정적인 메소드

Get the direction of the current culture.
public static IsRightToLeftCulture ( ) : bool
리턴 bool

ObfuscateText() 공개 정적인 메소드

Obfuscates text, replacing each character with its HTML escaped sequence, for example a becomes a.
public static ObfuscateText ( string input ) : string
input string The input text.
리턴 string

RemoveHtmlMarkup() 공개 정적인 메소드

Removes all HTML tags from a text.
public static RemoveHtmlMarkup ( string html ) : string
html string The input HTML.
리턴 string

TimeSpanToString() 공개 정적인 메소드

Converts a Time Span to string.
public static TimeSpanToString ( System.TimeSpan span ) : string
span System.TimeSpan The Time Span.
리턴 string

UnescapeString() 공개 정적인 메소드

Unescapes bad characters in a string (pipes and \n).
public static UnescapeString ( string input ) : string
input string The input string.
리턴 string

UrlDecode() 공개 정적인 메소드

Executes URL-decoding, replacing spaces as processed by UrlEncode.
public static UrlDecode ( string input ) : string
input string The input string.
리턴 string

UrlEncode() 공개 정적인 메소드

Executes URL-encoding, avoiding to use '+' for spaces.
public static UrlEncode ( string input ) : string
input string The input string.
리턴 string