Class
JsonFormatProvider

A workbook format provider that exports spreadsheet content to a structured JSON representation. This provider is export-only; importing JSON back into a workbook is not supported.

Definition

Namespace:Telerik.Windows.Documents.Spreadsheet.FormatProviders.Json

Assembly:Telerik.Windows.Documents.Spreadsheet.FormatProviders.Json.dll

Syntax:

cs-api-definition
public class JsonFormatProvider : BinaryWorkbookFormatProviderBase, IBinaryWorkbookFormatProvider, IWorkbookFormatProvider

Inheritance: objectWorkbookFormatProviderBaseBinaryWorkbookFormatProviderBaseJsonFormatProvider

Implements: IBinaryWorkbookFormatProviderIWorkbookFormatProvider

Inherited Members BinaryWorkbookFormatProviderBase.Import(byte[])BinaryWorkbookFormatProviderBase.Import(byte[], TimeSpan?)BinaryWorkbookFormatProviderBase.Export(Workbook)BinaryWorkbookFormatProviderBase.Export(Workbook, TimeSpan?)WorkbookFormatProviderBase.Import(Stream)WorkbookFormatProviderBase.Import(Stream, TimeSpan?)WorkbookFormatProviderBase.Export(Workbook, Stream)WorkbookFormatProviderBase.Export(Workbook, Stream, TimeSpan?)

Constructors

JsonFormatProvider()

Initializes a new instance of the JsonFormatProvider class with default JsonExportSettings.

Declaration

cs-api-definition
public JsonFormatProvider()

Properties

CanExport

Gets a value indicating whether export is supported (always true).

Declaration

cs-api-definition
public override bool CanExport { get; }

Property Value

bool

Overrides WorkbookFormatProviderBase.CanExport

CanImport

Gets a value indicating whether import is supported (always false for this provider).

Declaration

cs-api-definition
public override bool CanImport { get; }

Property Value

bool

Overrides WorkbookFormatProviderBase.CanImport

ExportSettings

Gets or sets the export settings controlling JSON output. If null at export time, defaults are applied.

Declaration

cs-api-definition
public JsonExportSettings ExportSettings { get; set; }

Property Value

JsonExportSettings

FilesDescription

Gets a human-readable description of the file type handled by this provider.

Declaration

cs-api-definition
public override string FilesDescription { get; }

Property Value

string

Overrides WorkbookFormatProviderBase.FilesDescription

Name

Gets the provider name.

Declaration

cs-api-definition
public override string Name { get; }

Property Value

string

Overrides WorkbookFormatProviderBase.Name

SupportedExtensions

Gets the set of supported file extensions (currently only ".json").

Declaration

cs-api-definition
public override IEnumerable<string> SupportedExtensions { get; }

Property Value

IEnumerable<string>

Overrides WorkbookFormatProviderBase.SupportedExtensions

Methods

ExportOverride(Workbook, Stream)

Exports the specified workbook to the output output using None.

Declaration

cs-api-definition
[Obsolete("This method is obsolete. Please use ExportOverride(Workbook workbook, Stream output, CancellationToken cancellationToken) instead.")]
protected override void ExportOverride(Workbook workbook, Stream output)

Parameters

workbook

Workbook

The workbook to export.

output

Stream

The destination stream.

Overrides WorkbookFormatProviderBase.ExportOverride(Workbook, Stream)

ExportOverride(Workbook, Stream, CancellationToken)

Performs the export operation writing a JSON representation of workbook into output.

Declaration

cs-api-definition
protected override void ExportOverride(Workbook workbook, Stream output, CancellationToken cancellationToken)

Parameters

workbook

Workbook

The workbook to export.

output

Stream

The destination stream (must be writable).

cancellationToken

CancellationToken

Token used to observe cancellation requests.

Exceptions

ArgumentNullException

Thrown if workbook or output is null.

Overrides WorkbookFormatProviderBase.ExportOverride(Workbook, Stream, CancellationToken)

ImportOverride(Stream)

Import is not supported and always throws NotSupportedException.

Declaration

cs-api-definition
[Obsolete("Import not supported for JsonFormatProvider.")]
protected override Workbook ImportOverride(Stream input)

Parameters

input

Stream

The input stream.

Returns

Workbook

Never returns; always throws.

Overrides WorkbookFormatProviderBase.ImportOverride(Stream)

ImportOverride(Stream, CancellationToken)

Import with cancellation is not supported and always throws NotSupportedException.

Declaration

cs-api-definition
protected override Workbook ImportOverride(Stream input, CancellationToken cancellationToken)

Parameters

input

Stream

The input stream.

cancellationToken

CancellationToken

Cancellation token (ignored).

Returns

Workbook

Never returns; always throws.

Overrides WorkbookFormatProviderBase.ImportOverride(Stream, CancellationToken)