C# Class Subtext.Web.Controls.ScriptHelper

Contains helper methods for unpacking scripts embedded as assembly resources.
Afficher le fichier Open project: ayende/Subtext

Méthodes publiques

Méthode 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

Méthode Description
UnpackEmbeddedResourceToString ( string resourceName ) : string

Unpacks the embedded resource to string.

Method Details

UnpackScript() public static méthode

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.
Résultat string

UnpackScript() public static méthode

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.
Résultat string