Class DrawingSurfaces
- Namespace
- RDCore.Forms.Drawing
- Assembly
- RDCore.Forms.dll
The drawing surface of each shown form and PictureBox, by its component: where a program's drawing statements go.
public static class DrawingSurfaces
- Inheritance
-
DrawingSurfaces
- Inherited Members
Remarks
A form's view registers the surfaces of its root and its PictureBoxes while it is shown, and unregisters them when it is closed. A component holds no reference to its surface, so a component no longer shown can be collected.
Methods
Of(ComponentInstance)
The surface a component draws on.
public static IDrawingSurface? Of(ComponentInstance component)
Parameters
componentComponentInstanceThe form's root or the PictureBox.
Returns
- IDrawingSurface
Its surface, or null where it is not shown, or has none.
Exceptions
- ArgumentNullException
componentis null.
Register(IDrawingSurface)
Registers the surface of a shown component, in place of any it had.
public static void Register(IDrawingSurface surface)
Parameters
surfaceIDrawingSurfaceThe surface, registered for its Component.
Exceptions
- ArgumentNullException
surfaceis null.
Unregister(IDrawingSurface)
Unregisters a surface, where it is still the one its component has.
public static void Unregister(IDrawingSurface surface)
Parameters
surfaceIDrawingSurfaceThe surface.
Exceptions
- ArgumentNullException
surfaceis null.