Table of Contents

Class RelationshipView

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

An instance of a model relationship in a View.

[DataContract]
public sealed class RelationshipView : IEquatable<RelationshipView>
Inheritance
RelationshipView
Implements
Inherited Members

Fields

Response

Indicates whether this relationship view represents a response message in a dynamic view.

[DataMember(Name = "response", EmitDefaultValue = false)]
public bool? Response

Field Value

bool?

Properties

Description

The description of this relationship (used in dynamic views only).

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

Property Value

string

Id

The ID of the relationship.

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

Property Value

string

The ID of the relationship.

Order

The order of this relationship (used in dynamic views only; e.g. 1.0, 1.1, 2.0, etc).

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

Property Value

string

Position

The position of the annotation along the line; 0 (start) to 100 (end).

[DataMember(Name = "position", EmitDefaultValue = false)]
public int? Position { get; set; }

Property Value

int?

Relationship

References the model relationship represented by this view edge.

public Relationship Relationship { get; set; }

Property Value

Relationship

Routing

The routing of the line.

[DataMember(Name = "routing", EmitDefaultValue = false)]
public Routing? Routing { get; set; }

Property Value

Routing?

Vertices

The set of vertices used to render the relationship.

[DataMember(Name = "vertices", EmitDefaultValue = false)]
public List<Vertex> Vertices { get; }

Property Value

List<Vertex>

Methods

AddVertex(Vertex)

Adds a connector vertex to the end of this relationship view.

public void AddVertex(Vertex vertex)

Parameters

vertex Vertex

The connector vertex to add.

Exceptions

ArgumentNullException

Thrown when vertex is null.

ClearVertices()

Removes all connector vertices from this relationship view.

public void ClearVertices()

Equals(RelationshipView)

Determines whether another relationship view represents the same relationship, order, and description.

public bool Equals(RelationshipView relationshipView)

Parameters

relationshipView RelationshipView

The relationship view to compare.

Returns

bool

true when both views are equivalent; otherwise, false.

Equals(object)

Determines whether another object represents the same relationship view.

public override bool Equals(object obj)

Parameters

obj object

The object to compare.

Returns

bool

true when the object is an equivalent RelationshipView; otherwise, false.

GetHashCode()

Returns a hash code based on the relationship identity and dynamic-view metadata.

public override int GetHashCode()

Returns

int

A hash code for this relationship view.

RemoveVertex(Vertex)

Removes a connector vertex from this relationship view.

public bool RemoveVertex(Vertex vertex)

Parameters

vertex Vertex

The connector vertex to remove.

Returns

bool

true if the vertex was removed; otherwise, false.

Exceptions

ArgumentNullException

Thrown when vertex is null.

SetVertices(IEnumerable<Vertex>)

Replaces the connector vertices for this relationship view.

public void SetVertices(IEnumerable<Vertex> vertices)

Parameters

vertices IEnumerable<Vertex>

The ordered connector vertices.

Exceptions

ArgumentNullException

Thrown when vertices is null.

ArgumentException

Thrown when vertices contains a null entry.

ToString()

Returns the wrapped relationship text.

public override string ToString()

Returns

string

A human-readable representation of the relationship view.