Load
Namespace: Digi21.DigiNG.DigiTab
Assembly: Digi21.DigiNG
Loads a code table from a file.
public static DigiTab Load(string path)
Parameters
| Parameter | Description |
|---|---|
path |
Code table file path. |
The format is selected by the extension of path:
.xmlextension (for exampletabla.tab.xml): code table XML file.- Any other extension: ZIP file containing a
Digi.tab.xmlentry, the format generated by Write with an extension other than.xml.
Returns
A modifiable DigiTab, with Path equal to path. Call Dispose (or use using) when you no longer need the table.
Exceptions
| Exception | When |
|---|---|
ArgumentNullException |
path is null. |
FileNotFoundException |
The file path does not exist. |
Exception |
The file cannot be read, the XML has errors (the message indicates the line and column), the ZIP does not contain Digi.tab.xml, or the code table is encrypted (the ZIP contains Digi.tab.xml.encrypted). The message describes the error. |
Example
try
{
using var tabla = DigiTab.Load(@"C:\Tablas\tabla.tab.xml");
Console.WriteLine($"{tabla.Codes.Count()} códigos en {tabla.Path}");
}
catch (FileNotFoundException e)
{
Console.WriteLine(e.Message);
}