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
HorizontalstringThe RDForms class of a horizontal control.
VerticalstringThe 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
HorizontalOrientation
The value of fmOrientationHorizontal.
public const int HorizontalOrientation = 1
Field Value
VerticalOrientation
The value of fmOrientationVertical.
public const int VerticalOrientation = 0
Field Value
Properties
Horizontal
The RDForms class of a horizontal control.
public string Horizontal { get; init; }
Property Value
Vertical
The RDForms class of a vertical control.
public string Vertical { get; init; }
Property Value
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
orientationintThe control's
Orientation: Auto, VerticalOrientation or HorizontalOrientation.widthdoubleThe control's width, in any unit.
heightdoubleThe control's height, in the unit of
width.
Returns
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
rdFormsNamestringThe control's RDForms class: Horizontal or Vertical.
Returns
- PortDiagnostic
The diagnostic.