Table of Contents

Class OrientationPort

Namespace
RDCore.Forms.Porting
Assembly
RDCore.Forms.dll

The two RDForms classes a legacy class with an Orientation ports to, such as MSForms' ScrollBar to RDForms.HScrollBar or RDForms.VScrollBar.

public sealed record OrientationPort : IEquatable<OrientationPort>
Inheritance
OrientationPort
Implements
Inherited Members

Remarks

The designer port knows each control's orientation and size, so it picks one class per control. A reference in code that the rewriter cannot tie to one control is typed RDFormsName.

Constructors

OrientationPort(string, string)

The two RDForms classes a legacy class with an Orientation ports to, such as MSForms' ScrollBar to RDForms.HScrollBar or RDForms.VScrollBar.

public OrientationPort(string Horizontal, string Vertical)

Parameters

Horizontal string

The RDForms class of a horizontal control.

Vertical string

The RDForms class of a vertical control.

Remarks

The designer port knows each control's orientation and size, so it picks one class per control. A reference in code that the rewriter cannot tie to one control is typed RDFormsName.

Fields

Auto

The value of fmOrientationAuto: the orientation follows the control's longer side.

public const int Auto = -1

Field Value

int

HorizontalOrientation

The value of fmOrientationHorizontal.

public const int HorizontalOrientation = 1

Field Value

int

VerticalOrientation

The value of fmOrientationVertical.

public const int VerticalOrientation = 0

Field Value

int

Properties

Horizontal

The RDForms class of a horizontal control.

public string Horizontal { get; init; }

Property Value

string

Vertical

The RDForms class of a vertical control.

public string Vertical { get; init; }

Property Value

string

Methods

RDFormsNameOf(int, double, double)

The RDForms class of a control with a given orientation and size.

public string? RDFormsNameOf(int orientation, double width, double height)

Parameters

orientation int

The control's Orientation: Auto, VerticalOrientation or HorizontalOrientation.

width double

The control's width, in any unit.

height double

The control's height, in the unit of width.

Returns

string

The class, or null when orientation is none of the three values.

Remarks

With Auto, a control wider than it is tall is horizontal, and any other is vertical.

TypeNameChanged(string)

What the code port reports at a TypeName or TypeOf ... Is comparison on a control ported to one of the two classes, whose type name is no longer the legacy class's.

public PortDiagnostic TypeNameChanged(string rdFormsName)

Parameters

rdFormsName string

The control's RDForms class: Horizontal or Vertical.

Returns

PortDiagnostic

The diagnostic.