Table of Contents

Class GElement

Namespace
NMF.Glsp.Graph
Assembly
NMF.Glsp.dll

Denotes a node in the graph model of GLSP

public class GElement
Inheritance
GElement
Derived
Inherited Members

Constructors

GElement()

Creates a new element

public GElement()

GElement(string)

Creates a new element

public GElement(string id)

Parameters

id string

The id of the new element

Remarks

If the id is null, a new id is generated

Properties

Alignment

Gets or sets the alignment of the element

[JsonIgnore]
public Point? Alignment { get; set; }

Property Value

Point?

Children

Gets a collection of child elements

public IListExpression<GElement> Children { get; }

Property Value

IListExpression<GElement>

CssClasses

Gets CSS classes assigned to this element

[JsonIgnore]
public IListExpression<string> CssClasses { get; }

Property Value

IListExpression<string>

Details

Gets a dictionary of details for this element

[JsonIgnore]
public IDictionary<string, object> Details { get; }

Property Value

IDictionary<string, object>

Graph

The graph that this element belongs to

[JsonIgnore]
public virtual GGraph Graph { get; }

Property Value

GGraph

Id

Gets the id of the element

public string Id { get; }

Property Value

string

Parent

Gets or sets the parent of the graph element

[JsonIgnore]
public GElement Parent { get; set; }

Property Value

GElement

Position

Gets or sets the position of the element

[JsonIgnore]
public Point? Position { get; set; }

Property Value

Point?

Size

Gets or sets the size of the element

[JsonIgnore]
public Dimension? Size { get; set; }

Property Value

Dimension?

Type

Gets or sets the type of the element

public string Type { get; set; }

Property Value

string

Methods

Delete()

Deletes this model element

public void Delete()

Set<T>(ref T, T)

Sets the given field and return if any changes have been made

protected bool Set<T>(ref T field, T value)

Parameters

field T

The field

value T

The new value

Returns

bool

True, if the value is different than the field, otherwise false

Type Parameters

T

The field type

TryPerform(string, IGlspSession, IDictionary<string, object>, out Task)

Attempts to execute the operation of the given kind

public bool TryPerform(string kind, IGlspSession session, IDictionary<string, object> args, out Task task)

Parameters

kind string

The kind of operation to perform

session IGlspSession

The session in which the operation is performed

args IDictionary<string, object>

The arguments passed into the operation

task Task

The task that represents the running operation, or null of no operation was performed

Returns

bool

True, if the operation was started successfully, otherwise False

UpdateLayout()

Updates the layout for this element

public void UpdateLayout()

Events

AlignmentChanged

Raised when the alignment of this element changes

public event Action<GElement> AlignmentChanged

Event Type

Action<GElement>

Deleted

Raised when the element is deleted

public event Action Deleted

Event Type

Action

PositionChanged

Raised when the position of this element changes

public event Action<GElement> PositionChanged

Event Type

Action<GElement>

SizeChanged

Raised when the size of this element changes

public event Action<GElement> SizeChanged

Event Type

Action<GElement>