Table of Contents

Class Element

Namespace
C4.Net
Assembly
C4.Net.Core.dll

This is the superclass for all model elements.

[DataContract]
public abstract class Element : ModelItem
Inheritance
Element
Derived
Inherited Members

Properties

CanonicalName

Gets the canonical name that uniquely identifies this element within the model.

public abstract string CanonicalName { get; }

Property Value

string

Description

A short description of this element.

[DataMember(Name = "description", EmitDefaultValue = false)]
public string Description { get; set; }

Property Value

string

Model

The model that contains this element.

public Model Model { get; set; }

Property Value

Model

Name

The name of this element.

[DataMember(Name = "name", EmitDefaultValue = false)]
public virtual string Name { get; }

Property Value

string

Parent

Gets or sets the parent element in the model hierarchy.

public abstract Element Parent { get; set; }

Property Value

Element

Relationships

The outgoing relationships owned by this element.

[DataMember(Name = "relationships", EmitDefaultValue = false)]
public ISet<Relationship> Relationships { get; }

Property Value

ISet<Relationship>

Url

The URL where more information about this element can be found.

[DataMember(Name = "url", EmitDefaultValue = false)]
public string Url { get; set; }

Property Value

string

Methods

Equals(Element)

Compares this element with another element by canonical name.

public bool Equals(Element element)

Parameters

element Element

The element to compare with.

Returns

bool

true when both elements have the same canonical name; otherwise, false.

Equals(object)

Compares this element with another object by canonical name.

public override bool Equals(object obj)

Parameters

obj object

The object to compare with.

Returns

bool

true when obj is an equivalent Element; otherwise, false.

GetEfferentRelationshipWith(Element)

Gets the efferent (outgoing) relationship with the specified element.

public Relationship GetEfferentRelationshipWith(Element element)

Parameters

element Element

the element to look for

Returns

Relationship

a Relationship object if an efferent relationship exists, null otherwise

GetEfferentRelationshipWith(Element, string)

Gets the efferent (outgoing) relationship with the specified element and description.

public Relationship GetEfferentRelationshipWith(Element element, string description)

Parameters

element Element

the element to look for

description string

the relationship description

Returns

Relationship

a Relationship object, or null if the specified relationship doesn't exist

GetEfferentRelationshipsWith(Element)

Gets the efferent (outgoing) relationships with the specified element.

public ISet<Relationship> GetEfferentRelationshipsWith(Element element)

Parameters

element Element

the element to look for

Returns

ISet<Relationship>

a Set of Relationship objects; empty if no relationships exist

Has(Relationship)

Determines whether this element already owns the specified outgoing relationship.

public bool Has(Relationship relationship)

Parameters

relationship Relationship

The relationship to look for.

Returns

bool

true when the relationship is already attached to this element; otherwise, false.

HasAfferentRelationships()

Determines whether this element has afferent (incoming) relationships.

public bool HasAfferentRelationships()

Returns

bool

true if this element has afferent relationships, false otherwise

HasEfferentRelationshipWith(Element)

Determines whether this element has an efferent (outgoing) relationship with the specified element.

public bool HasEfferentRelationshipWith(Element element)

Parameters

element Element

the element to look for

Returns

bool

true if this element has an efferent relationship with the specified element, false otherwise

HasEfferentRelationshipWith(Element, string)

Determines whether this element has an efferent (outgoing) relationship with the specified element and description.

public bool HasEfferentRelationshipWith(Element element, string description)

Parameters

element Element

the element to look for

description string

the relationship description

Returns

bool

true if this element has an efferent relationship with the specified element and description, false otherwise

ToString()

Returns a readable representation containing the element ID, name, and description.

public override string ToString()

Returns

string

A string representation of this element.