Class DataBindingProvider
Data translation functionality for DataTableBase.
Inheritance
Namespace: GDX.DataTables.DataBinding
Syntax
public static class DataBindingProvider
Methods
| Improve this Doc View SourceExport(DataTableBase, String, Boolean)
Export the content of a given DataTableBase to a target format.
Declaration
public static void Export(DataTableBase dataTable, string uri, bool jsonFallback = true)
Parameters
| Type | Name | Description |
|---|---|---|
| DataTableBase | dataTable | The DataTableBase |
| System.String | uri | The output path/uri where to send the data, absolute if on disk |
| System.Boolean | jsonFallback | If the format cannot be determined by the uri, fallback to JSON. |
GetFormatFromFile(String)
Declaration
public static FormatBase GetFormatFromFile(string filePath)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | filePath |
Returns
| Type | Description |
|---|---|
| FormatBase |
GetFormatFromUri(String)
Declaration
public static FormatBase GetFormatFromUri(string uri)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | uri |
Returns
| Type | Description |
|---|---|
| FormatBase |
GetFormats()
Declaration
public static FormatBase[] GetFormats()
Returns
| Type | Description |
|---|---|
| FormatBase[] |
GetImportDialogExtensions()
Declaration
public static string[] GetImportDialogExtensions()
Returns
| Type | Description |
|---|---|
| System.String[] |
Import(DataTableBase, String, Boolean, Boolean)
Update the DataTableBase with the data found in the given file.
Declaration
public static bool Import(DataTableBase dataTable, string uri, bool removeRowIfNotFound = true, bool jsonFallback = true)
Parameters
| Type | Name | Description |
|---|---|---|
| DataTableBase | dataTable | The target DataTableBase to apply changes to. |
| System.String | uri | The resource path to load data from, absolute if on disk. |
| System.Boolean | removeRowIfNotFound | Should rows that are not found in the file content be removed? |
| System.Boolean | jsonFallback | If the importer is unable to determine the format based on the URI, fallback to assuming its JSON. |
Returns
| Type | Description |
|---|---|
| System.Boolean | Was the import successful? |
Remarks
It's important that the Row Identifier column remains unchanged, no structural changes have occured, and no changes of column order were made. Object references will be maintained during update, only values will be updated.
RegisterFormat(FormatBase)
Declaration
public static void RegisterFormat(FormatBase format)
Parameters
| Type | Name | Description |
|---|---|---|
| FormatBase | format |
UnregisterFormat(FormatBase)
Declaration
public static void UnregisterFormat(FormatBase format)
Parameters
| Type | Name | Description |
|---|---|---|
| FormatBase | format |