ZpToCsx
static class · namespace z3n7.Tools · source Tools/ZpToCsx.cs
public static class ZpToCsx
Converts a ZennoPoster project (.zp) into a C# script (.csx) outline and builds .zp files from XML. Works only inside ProjectMaker: it uses the ProjectMaker assembly loaded in the process.
Methods
ExtractXml
public static string ExtractXml(string zpPath)
Unpacks the project XML of a .zp file.
Returns: The XML; the loader's exception text when it fails; null outside ProjectMaker.
GenerateCsx
public static string GenerateCsx(string zpPath)
Generates a C# script from a project: #r references, usings, InitVariables with the variable defaults, and Execute with one labelled block per action in reachability order, goto jumps for the branches, and each action's type and parameters as comments.
| Parameter | Description |
|---|---|
zpPath |
Project file. |
Template
public static string Template()
The embedded empty project (.zp) as Base64.
XmlToZp
public static void XmlToZp(string xml, string zpPath)
Builds a .zp file from project XML, using an empty project embedded in the library as the container.
| Parameter | Description |
|---|---|
xml |
Project XML. |
zpPath |
Target file. |