Class GElement
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
stringThe 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
Children
Gets a collection of child elements
public IListExpression<GElement> Children { get; }
Property Value
CssClasses
Gets CSS classes assigned to this element
[JsonIgnore]
public IListExpression<string> CssClasses { get; }
Property Value
Details
Gets a dictionary of details for this element
[JsonIgnore]
public IDictionary<string, object> Details { get; }
Property Value
Graph
The graph that this element belongs to
[JsonIgnore]
public virtual GGraph Graph { get; }
Property Value
Id
Gets the id of the element
public string Id { get; }
Property Value
Parent
Gets or sets the parent of the graph element
[JsonIgnore]
public GElement Parent { get; set; }
Property Value
Position
Gets or sets the position of the element
[JsonIgnore]
public Point? Position { get; set; }
Property Value
Size
Gets or sets the size of the element
[JsonIgnore]
public Dimension? Size { get; set; }
Property Value
Type
Gets or sets the type of the element
public string Type { get; set; }
Property Value
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
TThe field
value
TThe 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
stringThe kind of operation to perform
session
IGlspSessionThe session in which the operation is performed
args
IDictionary<string, object>The arguments passed into the operation
task
TaskThe 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
Deleted
Raised when the element is deleted
public event Action Deleted
Event Type
PositionChanged
Raised when the position of this element changes
public event Action<GElement> PositionChanged
Event Type
SizeChanged
Raised when the size of this element changes
public event Action<GElement> SizeChanged