C# Class Nexus.Client.ModManagement.Scripting.XmlScript.XmlScriptType

Describes the XML script type.
This is the script that allows scripting using an XML language. It is meant to be easier to learn and more accessible than the more advanced C# script.
Inheritance: IScriptType
Show file Open project: NexusMods/NexusModManager-4.5 Class Usage Examples

Protected Properties

Property Type Description
m_rgxVersion System.Text.RegularExpressions.Regex

Public Methods

Method Description
CreateConditionStateManager ( IMod p_modMod, IGameMode p_gmdGameMode, IPluginManager p_pmgPluginManager, IEnvironmentInfo p_eifEnvironmentInfo ) : ConditionStateManager

Creates a ConditionStateManager to use when running an XML script.

CreateEditor ( IList p_lstModFiles ) : IScriptEditor

Creates an editor for the script type.

CreateExecutor ( IMod p_modMod, IGameMode p_gmdGameMode, IEnvironmentInfo p_eifEnvironmentInfo, InstallerGroup p_igpInstallers, SynchronizationContext p_scxUIContext ) : IScriptExecutor

Creates an executor that can run the script type.

GetCplParserFactory ( ) : ICplParserFactory

Gets a CPL Parser factory.

GetSupportedXmlScriptEditCommands ( System.Version p_verXmlScriptVersion ) : XmlScriptEditCommands

Gets the commands supported by the specified XML Script version.

GetXmlScriptNodeAdapter ( System.Version p_verXmlScriptVersion ) : IXmlScriptNodeAdapter

The factory method that returns the appropriate IXmlScriptNodeAdapter for the given xml script version.

GetXmlScriptSchema ( System.Version p_verXmlScriptVersion ) : XmlSchema

Gets the path to the schema file for the specified xml script version.

GetXmlScriptVersion ( System.Xml.Linq.XElement p_xelScript ) : System.Version

Gets the config version used by the given XML configuration file.

GetXmlScriptVersion ( string p_strXml ) : System.Version

Gets the config version used by the given XML configuration file.

IsXmlScriptValid ( System.Xml.Linq.XElement p_xelScript ) : bool

Validates the given Xml Script against the appropriate schema.

LoadScript ( string p_strScriptData ) : IScript

Loads the script from the given text representation.

SaveScript ( IScript p_scpScript ) : string

Saves the given script into a text representation.

ValidateScript ( IScript p_scpScript ) : bool

Determines if the given script is valid.

ValidateXmlScript ( System.Xml.Linq.XElement p_xelScript ) : void

Validates the given Xml Script against the appropriate schema.

Protected Methods

Method Description
GetParser ( System.Xml.Linq.XElement p_xelScript ) : IParser

Gets a parser for the given script.

GetUnparser ( XmlScript p_xscScript ) : IUnparser

Gets a unparser for the given script.

Method Details

CreateConditionStateManager() public method

Creates a ConditionStateManager to use when running an XML script.
public CreateConditionStateManager ( IMod p_modMod, IGameMode p_gmdGameMode, IPluginManager p_pmgPluginManager, IEnvironmentInfo p_eifEnvironmentInfo ) : ConditionStateManager
p_modMod IMod The mod being installed.
p_gmdGameMode IGameMode The game mode currently bieng managed.
p_pmgPluginManager IPluginManager The plugin manager.
p_eifEnvironmentInfo IEnvironmentInfo The application's envrionment info.
return ConditionStateManager

CreateEditor() public method

Creates an editor for the script type.
public CreateEditor ( IList p_lstModFiles ) : IScriptEditor
p_lstModFiles IList The list of files if the current mod.
return IScriptEditor

CreateExecutor() public method

Creates an executor that can run the script type.
public CreateExecutor ( IMod p_modMod, IGameMode p_gmdGameMode, IEnvironmentInfo p_eifEnvironmentInfo, InstallerGroup p_igpInstallers, SynchronizationContext p_scxUIContext ) : IScriptExecutor
p_modMod IMod The mod being installed.
p_gmdGameMode IGameMode The game mode currently bieng managed.
p_eifEnvironmentInfo IEnvironmentInfo The application's envrionment info.
p_igpInstallers InstallerGroup The utility class to use to install the mod items.
p_scxUIContext System.Threading.SynchronizationContext The to use to marshall UI interactions to the UI thread.
return IScriptExecutor

GetCplParserFactory() public method

Gets a CPL Parser factory.
public GetCplParserFactory ( ) : ICplParserFactory
return ICplParserFactory

GetParser() protected method

Gets a parser for the given script.
protected GetParser ( System.Xml.Linq.XElement p_xelScript ) : IParser
p_xelScript System.Xml.Linq.XElement The script for which to get a parser.
return IParser

GetSupportedXmlScriptEditCommands() public method

Gets the commands supported by the specified XML Script version.
public GetSupportedXmlScriptEditCommands ( System.Version p_verXmlScriptVersion ) : XmlScriptEditCommands
p_verXmlScriptVersion System.Version The XML script file version for which to return a schema.
return XmlScriptEditCommands

GetUnparser() protected method

Gets a unparser for the given script.
protected GetUnparser ( XmlScript p_xscScript ) : IUnparser
p_xscScript XmlScript The script for which to get an unparser.
return IUnparser

GetXmlScriptNodeAdapter() public method

The factory method that returns the appropriate IXmlScriptNodeAdapter for the given xml script version.
Thrown if no is /// found for the given xml script version.
public GetXmlScriptNodeAdapter ( System.Version p_verXmlScriptVersion ) : IXmlScriptNodeAdapter
p_verXmlScriptVersion System.Version The xml script version for which to create an /// .
return IXmlScriptNodeAdapter

GetXmlScriptSchema() public method

Gets the path to the schema file for the specified xml script version.
public GetXmlScriptSchema ( System.Version p_verXmlScriptVersion ) : XmlSchema
p_verXmlScriptVersion System.Version The XML script file version for which to return a schema.
return System.Xml.Schema.XmlSchema

GetXmlScriptVersion() public method

Gets the config version used by the given XML configuration file.
public GetXmlScriptVersion ( System.Xml.Linq.XElement p_xelScript ) : System.Version
p_xelScript System.Xml.Linq.XElement The XML file whose version is to be determined.
return System.Version

GetXmlScriptVersion() public method

Gets the config version used by the given XML configuration file.
public GetXmlScriptVersion ( string p_strXml ) : System.Version
p_strXml string The XML file whose version is to be determined.
return System.Version

IsXmlScriptValid() public method

Validates the given Xml Script against the appropriate schema.
public IsXmlScriptValid ( System.Xml.Linq.XElement p_xelScript ) : bool
p_xelScript System.Xml.Linq.XElement The script file.
return bool

LoadScript() public method

Loads the script from the given text representation.
public LoadScript ( string p_strScriptData ) : IScript
p_strScriptData string The text to convert into a script.
return IScript

SaveScript() public method

Saves the given script into a text representation.
public SaveScript ( IScript p_scpScript ) : string
p_scpScript IScript The to save.
return string

ValidateScript() public method

Determines if the given script is valid.
public ValidateScript ( IScript p_scpScript ) : bool
p_scpScript IScript The script to validate.
return bool

ValidateXmlScript() public method

Validates the given Xml Script against the appropriate schema.
public ValidateXmlScript ( System.Xml.Linq.XElement p_xelScript ) : void
p_xelScript System.Xml.Linq.XElement The script file.
return void

Property Details

m_rgxVersion protected static property

Extracts the config version from a XML configuration file.
protected static Regex,System.Text.RegularExpressions m_rgxVersion
return System.Text.RegularExpressions.Regex