C# Class Subtext.Web.Controls.ScriptHelper

Contains helper methods for unpacking scripts embedded as assembly resources.
ファイルを表示 Open project: ayende/Subtext

Public Methods

Method Description
UnpackScript ( string scriptName ) : string

Returns a string representation of the specified embedded script file. The script is wrapped with script start and end tags and assumes the script language is "vbscript" if the file extension is ".vbs" and "javascript" otherwise.

Using a naming convention, all scripts are placed in the Resources\Scripts folder. The ScriptName should just be the filename of the script. For example, if you embed a file at the following location "Resources\Scripts\MyScript.js", the ScriptName to pass is "MyScript.js".

UnpackScript ( string scriptName, string scriptLanguage ) : string

Returns a string representation of the specified embedded script file. The script is wrapped with script start and end tags and assumes the script language is "javascript".

Using a naming convention, all scripts are placed in the Resources\Scripts folder. The ScriptName should just be the filename of the script. For example, if you embed a file at the following location "Resources\Scripts\MyScript.js", the ScriptName to pass is "MyScript.js".

Private Methods

Method Description
UnpackEmbeddedResourceToString ( string resourceName ) : string

Unpacks the embedded resource to string.

Method Details

UnpackScript() public static method

Returns a string representation of the specified embedded script file. The script is wrapped with script start and end tags and assumes the script language is "vbscript" if the file extension is ".vbs" and "javascript" otherwise.
Using a naming convention, all scripts are placed in the Resources\Scripts folder. The ScriptName should just be the filename of the script. For example, if you embed a file at the following location "Resources\Scripts\MyScript.js", the ScriptName to pass is "MyScript.js".
public static UnpackScript ( string scriptName ) : string
scriptName string FileName of the script. Just the file name.
return string

UnpackScript() public static method

Returns a string representation of the specified embedded script file. The script is wrapped with script start and end tags and assumes the script language is "javascript".
Using a naming convention, all scripts are placed in the Resources\Scripts folder. The ScriptName should just be the filename of the script. For example, if you embed a file at the following location "Resources\Scripts\MyScript.js", the ScriptName to pass is "MyScript.js".
public static UnpackScript ( string scriptName, string scriptLanguage ) : string
scriptName string FileName of the script. Just the file name.
scriptLanguage string The script language.
return string