[]
        
(Showing Draft Content)

GrapeCity.Documents.Layout.Composition.Surface

Class Surface

Namespace
GrapeCity.Documents.Layout.Composition
Assembly
GcDocs.Imaging.dll

Represents a surface that can draw its views on a GcGraphics.

public class Surface
Inheritance
object
Surface
Inherited Members
object.Equals(object)
object.Equals(object, object)
object.ReferenceEquals(object, object)
object.GetHashCode()
object.GetType()
object.MemberwiseClone()

Constructors

Surface()

Initializes a new instance of the Surface object with a LayoutHost.

public Surface()

Properties

BaseTransform

Gets the transformation matrix of the GcGraphics object when it was passed to the Render(GcGraphics) method.

Returns an identity matrix when checked outside of the Render(GcGraphics) method.

public Matrix3x2 BaseTransform { get; }

Property Value

System.Numerics.Matrix3x2

BottomLayer

Gets the view that appears below all other views on this Surface.

public Layer BottomLayer { get; }

Property Value

Layer

LayoutHost

Gets the associated LayoutHost object.

public LayoutHost LayoutHost { get; }

Property Value

LayoutHost

Name

Gets or sets the name of the Surface.

public string Name { get; set; }

Property Value

string

Tag

Gets or sets an object that contains arbitrary data associated with this surface.

public object Tag { get; set; }

Property Value

object

ThrowIfNotFit

Gets or sets a value indicating whether a LayoutException should be thrown if the width or height of some LayoutRects becomes negative.

The default is true.

public bool ThrowIfNotFit { get; set; }

Property Value

bool

TopLayer

Gets the view that appears above all other views on this Surface.

public Layer TopLayer { get; }

Property Value

Layer

Methods

CreateView(float, float, Action<GcGraphics, Layer>)

Creates a View object that encapsulates a LayoutView and adds it as the top layer.

public View CreateView(float width, float height, Action<GcGraphics, Layer> draw)

Parameters

width float

The width of the associated LayoutView.

height float

The height of the associated LayoutView.

draw System.Action<T1, T2><GcGraphics, Layer>

A delegate that accepts a GcGraphics object and a Layer, and draws the layer on the graphics.

Returns

View

CreateView(float, float)

Creates a View object that encapsulates a LayoutView and adds it as the top layer.

public View CreateView(float width, float height)

Parameters

width float

The width of the associated LayoutView.

height float

The height of the associated LayoutView.

Returns

View

GetViews()

Returns the array of views on this Surface.

public View[] GetViews()

Returns

View[]

PerformLayout()

Recalculates the layout of all Visual and Space objects on this Surface.

public bool PerformLayout()

Returns

bool

true if successful, false if the width or height of any LayoutRect has become negative and the ThrowIfNotFit is false.

Render(GcGraphics)

Draws this Surface on a specified GcGraphics object.

This method first calls PerformLayout(), if the call succeeds it then draws all layers starting with the bottom layer and going up. For each layer, it draws all visuals from the bottom to the top one, followed by drawing the layer's sub-layers. The process repeats until the topmost visual of the top layer has been drawn.

public bool Render(GcGraphics graphics)

Parameters

graphics GcGraphics

The target GcGraphics object.

Returns

bool

The result of executing the PerformLayout() method.

ToString()

Returns a string that represents the current Surface.

public override string ToString()

Returns

string