Table of Contents

Class FormXamlDocumentReader

Namespace
RDCore.Forms.Xaml
Assembly
RDCore.Forms.dll

Reads an RDForms form's document for the platform: what the form declares, as a RDCore.SDK.Workspace.Forms.FormDescriptor, from the .xaml beside its .rdform module.

public sealed class FormXamlDocumentReader : IFormDocumentReader
Inheritance
FormXamlDocumentReader
Implements
IFormDocumentReader
Inherited Members

Remarks

A program that loads RDForms forms registers it once, before it reads one: FormDesigner.Register(FormXamlDocumentReader.Instance) (RDCore.SDK.Workspace.Forms.FormDesigner.Register(RDCore.SDK.Workspace.Forms.IFormDocumentReader)).

Properties

DocumentExtension

The extension of the documents it reads: RDCore.SDK.Workspace.Forms.FormDesigner.RDFormsDocumentExtension.

public string DocumentExtension { get; }

Property Value

string

Instance

The one instance of the reader, which keeps no state.

public static FormXamlDocumentReader Instance { get; }

Property Value

FormXamlDocumentReader

Methods

DescriptorOf(string)

What the form whose document's text is document declares, as Read(string) reads it.

public static FormDescriptor DescriptorOf(string document)

Parameters

document string

The document's text.

Returns

FormDescriptor

The form, of the RDCore.SDK.Workspace.Forms.FormDesignerKind.RDForms kind:

  • its root's name, and its class in the RDForms library (RDForms.Form);
  • its properties as the document writes them, by name, its lengths in device-independent pixels;
  • its controls and menu items, in the document's order, each with its class, its TabIndex and its Index in a control array where it has them, and the controls it holds;
  • the document's text, as its RDCore.SDK.Workspace.Forms.FormDescriptor.DesignerText.

A component the model cannot hold, kept as text (UnmodelledComponent), is not one of its controls.

Exceptions

ArgumentNullException

document is null.

FormDesignerFormatException

The document holds no form (RDCore.SDK.Workspace.Forms.FormDesignerFormatProblem.InvalidDocument).

Read(ReadOnlyMemory<byte>)

What the form whose document is document declares, as DescriptorOf(string) reads it from the document's text.

public FormDescriptor Read(ReadOnlyMemory<byte> document)

Parameters

document ReadOnlyMemory<byte>

The document's content, as its file holds it: UTF-8, unless a byte order mark says another Unicode encoding.

Returns

FormDescriptor

The form.

Exceptions

FormDesignerFormatException

The document holds no form (RDCore.SDK.Workspace.Forms.FormDesignerFormatProblem.InvalidDocument).