| title | SerializeInfo |
|---|---|
| parent | Framework |
| grand_parent | CustomControls Package |
| permalink | /tB/Packages/CustomControls/Framework/SerializeInfo |
| has_toc | false |
{: .no_toc }
The per-instance serializer for a custom control, returned by CustomControlContext.GetSerializer. The main entry point is RuntimeUISrzDeserialize --- called from a control's Initialize to load the designer-set property values that were saved into the form's serialized data. The remaining members expose framework state --- design-mode flag, runtime / report mode, owner window handle --- that a control may need while initializing.
Private Sub OnInitialize(ByVal Ctx As CustomControls.CustomControlContext) _
Implements CustomControls.ICustomControl.Initialize
With Ctx.GetSerializer
If Not .RuntimeUISrzDeserialize(Me, False) Then
InitializeDefaultValues
End If
Me.IsDesignMode = .RuntimeUISrzIsDesignMode()
End With
Set Me.ControlContext = Ctx
End Sub
{: .no_toc }
Loads the serialized property values for this control instance into Object. Returns True if serialized data was present and was applied, or False if no data was found --- in which case the control should apply its own defaults.
Syntax: SerializeInfo.RuntimeUISrzDeserialize ( Object, UseOuterOwner ) As Boolean
Object : required The custom control instance whose properties should be populated. From inside an Initialize implementation this is Me.
UseOuterOwner : required A Boolean flag for advanced use; pass False in normal cases.
{: .no_toc }
Returns the HWND of the parent form's underlying Win32 window.
Syntax: SerializeInfo.RuntimeUISrzGetFormHWND ( ) As LongPtr
{: .no_toc }
Returns a hint indicating the orientation of the parent form. Long.
Syntax: SerializeInfo.RuntimeUISrzGetOrientationHint ( ) As Long
{: .no_toc }
Returns the CLSID of the form class that owns this control, as a String.
Syntax: SerializeInfo.RuntimeUISrzGetRootCLSID ( ) As String
{: .no_toc }
Returns the form-class instance that owns this control, typed as an Object.
Syntax: SerializeInfo.RuntimeUISrzGetRootClassDispatch ( ) As Object
{: .no_toc }
Returns True if the control is being created at design time (inside the form designer) rather than at run time. Controls that want to render a placeholder at design time only --- like WaynesTimer, which draws its 🕑 glyph only when IsDesignMode is True --- read this flag during Initialize.
Syntax: SerializeInfo.RuntimeUISrzIsDesignMode ( ) As Boolean
{: .no_toc }
Returns True if the control is being created as part of a report-rendering pass.
Syntax: SerializeInfo.RuntimeUISrzIsReportMode ( ) As Boolean
{: .no_toc }
Returns True if the control was added at run time (via CustomControlsCollection.Add) rather than placed in the form designer.
Syntax: SerializeInfo.RuntimeUISrzIsRuntimeAdded ( ) As Boolean