[]
        
(Showing Draft Content)

GrapeCity.Documents.Layout.Composition.Layer

Class Layer

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

Represents a drawing layer with visuals, optional clipping, and nested layers.

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

Properties

BaseLayer

Gets the owner Layer if this is a nested Layer.

public Layer BaseLayer { get; }

Property Value

Layer

BottomNestedLayer

Gets the nested Layer that appears below all other nested Layers on this Layer.

public Layer BottomNestedLayer { get; }

Property Value

Layer

BottomVisual

Gets the Visual that appears below all other Visuals on this Layer.

public Visual BottomVisual { get; }

Property Value

Visual

ClipRect

Gets or sets a LayoutRect that affects the transformation matrix when clipping this Layer.

If the CreateClipRegion delegate is not assigned, the ClipRect rectangle is also used as a clipping region.

public LayoutRect ClipRect { get; set; }

Property Value

LayoutRect

CreateClipRegion

Gets or sets a delegate that creates a clipping region (IClipRegion) taking GcGraphics and Layer as parameters.

The transformation matrix of the clipping region is defined by the ClipRect.Transform property. If the ClipRect property is not assigned, the transformation matrix of the owner View is used.

public Func<GcGraphics, Layer, IClipRegion> CreateClipRegion { get; set; }

Property Value

System.Func<T1, T2, TResult><GcGraphics, Layer, IClipRegion>

Draw

Gets or sets a delegate that accepts a GcGraphics object and a Layer and draws the layer on the graphics.

public Action<GcGraphics, Layer> Draw { get; set; }

Property Value

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

IsDetached

Gets true if this Layer is not associated with any Surface, false otherwise.

public bool IsDetached { get; }

Property Value

bool

LayerAbove

Gets the sibling Layer that appears on top of the current Layer.

public Layer LayerAbove { get; }

Property Value

Layer

LayerBelow

Gets the sibling Layer that appears below the current Layer.

public Layer LayerBelow { get; }

Property Value

Layer

Name

Gets or sets the name of this Layer.

public string Name { get; set; }

Property Value

string

Surface

Gets the owner Surface object.

public Surface Surface { get; }

Property Value

Surface

Tag

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

public object Tag { get; set; }

Property Value

object

TopNestedLayer

Gets the nested Layer that appears on top of all other nested Layers on this Layer.

public Layer TopNestedLayer { get; }

Property Value

Layer

TopVisual

Gets the Visual that appears on top of all other Visuals on this Layer.

public Visual TopVisual { get; }

Property Value

Visual

View

If the current object is a Layer, gets the owner View. If the current object is a View, gets this object.

public View View { get; }

Property Value

View

Visible

Gets or sets a value indicating whether this Layer is visible.

public bool Visible { get; set; }

Property Value

bool

Methods

BringToFront()

Moves the layer to the front. It becomes the topmost nested layer of the base Layer or the top layer of the Surface.

public void BringToFront()

CreateSpace()

Creates a Space object that represents an invisible helper rectangle for easy layout of other elements.

public Space CreateSpace()

Returns

Space

CreateSpace(int)

Creates a Space object that represents an invisible helper rectangle for easy layout of other elements.

public Space CreateSpace(int id)

Parameters

id int

A custom space ID. It must be positive and unique within the View.

Returns

Space

CreateSubLayer()

Creates a nested Layer object and adds it on top of other nested layers.

public Layer CreateSubLayer()

Returns

Layer

CreateSubLayer(Action<GcGraphics, Layer>)

Creates a nested Layer object and adds it on top of other nested layers.

public Layer CreateSubLayer(Action<GcGraphics, Layer> draw)

Parameters

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

Layer

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

Creates a nested View object and adds it on top of other nested layers.

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

Parameters

width float

The width of the LayoutView rectangle.

height float

The height of the LayoutView rectangle.

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

CreateSubView(float, float)

Creates a nested View object and adds it on top of other nested layers.

public View CreateSubView(float width, float height)

Parameters

width float

The width of the LayoutView rectangle.

height float

The height of the LayoutView rectangle.

Returns

View

CreateVisual(AnchorPoint[], Action<GcGraphics, Visual>)

Creates a Visual object that represents a polygon based on the given AnchorPoints.

public Visual CreateVisual(AnchorPoint[] anchorPoints, Action<GcGraphics, Visual> draw)

Parameters

anchorPoints AnchorPoint[]

An array of AnchorPoints to draw.

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

A delegate that accepts a GcGraphics object and a Visual, and draws the visual on the graphics.

Returns

Visual

CreateVisual(AnchorPoint[])

Creates a Visual object that represents a polygon based on the given AnchorPoints.

public Visual CreateVisual(AnchorPoint[] anchorPoints)

Parameters

anchorPoints AnchorPoint[]

An array of AnchorPoints to draw.

Returns

Visual

CreateVisual(Contour, bool, Action<GcGraphics, Visual>)

Creates a Visual object that represents an element drawing the Contour.

public Visual CreateVisual(Contour contour, bool createRect, Action<GcGraphics, Visual> draw)

Parameters

contour Contour

A Contour to be associated with the Visual.

createRect bool

Indicates whether a new LayoutRect must be associated with the Visual.

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

A delegate that accepts a GcGraphics object and a Visual, and draws the visual on the graphics.

Returns

Visual

CreateVisual(Contour, bool)

Creates a Visual object that represents an element drawing the Contour.

public Visual CreateVisual(Contour contour, bool createRect)

Parameters

contour Contour

A Contour to be associated with the Visual.

createRect bool

Indicates whether a new LayoutRect must be associated with the Visual.

Returns

Visual

CreateVisual(Action<GcGraphics, Visual>)

Creates a Visual object that represents a drawing element.

public Visual CreateVisual(Action<GcGraphics, Visual> draw)

Parameters

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

A delegate that accepts a GcGraphics object and a Visual, and draws the visual on the graphics.

Returns

Visual

CreateVisual(bool)

Creates a Visual object that represents a drawing element.

public Visual CreateVisual(bool createRect = true)

Parameters

createRect bool

Indicates whether a new LayoutRect must be associated with the Visual.

Returns

Visual

CreateVisual(int, bool)

Creates a Visual object that represents a drawing element.

public Visual CreateVisual(int id, bool createRect = true)

Parameters

id int

A custom space ID. It must be positive and unique within the View.

createRect bool

Indicates whether a new LayoutRect must be associated with the Visual.

Returns

Visual

Detach()

Detaches this Layer from the owner Surface.

public virtual void Detach()

GetNestedLayers()

Returns the array of nested layers and views on this Layer.

public Layer[] GetNestedLayers()

Returns

Layer[]

GetVisuals()

Returns the array of Visual objects.

public Visual[] GetVisuals()

Returns

Visual[]

MoveAbove(Layer)

Moves the current Layer to the position on top of the specified layer.

public void MoveAbove(Layer layer)

Parameters

layer Layer

MoveBelow(Layer)

Moves the current Layer to the position below the specified layer.

public void MoveBelow(Layer layer)

Parameters

layer Layer

SendToBack()

Moves the layer to the back. It becomes the bottom nested layer of the base Layer or the bottom layer of the Surface.

public void SendToBack()

ToString()

Returns a string that represents the current Layer.

public override string ToString()

Returns

string