Table of Contents

Class View

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

Defines the shared metadata, elements, and relationships for a rendered architecture view.

[DataContract]
public abstract class View
Inheritance
View
Derived
Inherited Members

Fields

LayoutMergeStrategy

Selects the strategy used when copying layout information from another view instance.

public LayoutMergeStrategy LayoutMergeStrategy

Field Value

LayoutMergeStrategy

Properties

AutomaticLayout

Stores the automatic layout settings currently applied to the view.

[DataMember(Name = "automaticLayout", EmitDefaultValue = false)]
public AutomaticLayout AutomaticLayout { get; }

Property Value

AutomaticLayout

Description

Describes the purpose of the view.

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

Property Value

string

Dimensions

The dimensions of the view (in pixels).

[DataMember(Name = "dimensions", EmitDefaultValue = false)]
public Dimensions Dimensions { get; set; }

Property Value

Dimensions

Elements

The set of elements in this view.

[DataMember(Name = "elements", EmitDefaultValue = false)]
public ISet<ElementView> Elements { get; }

Property Value

ISet<ElementView>

Key

An identifier for this view.

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

Property Value

string

Model

Resolves the model that owns the elements displayed by this view.

public virtual Model Model { get; set; }

Property Value

Model

Remarks

The default setter intentionally ignores assigned values because most view types derive the model from their scope.

Name

Provides the generated name displayed for this view type.

public abstract string Name { get; }

Property Value

string

PaperSize

The paper size that should be used to render this view.

[DataMember(Name = "paperSize", EmitDefaultValue = false)]
public PaperSize PaperSize { get; set; }

Property Value

PaperSize

Relationships

The set of relationships in this view.

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

Property Value

ISet<RelationshipView>

SoftwareSystem

References the software system that defines the scope of this view when applicable.

public SoftwareSystem SoftwareSystem { get; set; }

Property Value

SoftwareSystem

SoftwareSystemId

The ID of the software system this view is associated with.

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

Property Value

string

Title

The title for this view.

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

Property Value

string

Methods

AddElement(Element, bool)

protected void AddElement(Element element, bool addRelationships)

Parameters

element Element
addRelationships bool

AddRelationship(Relationship)

protected RelationshipView AddRelationship(Relationship relationship)

Parameters

relationship Relationship

Returns

RelationshipView

CheckElementCanBeAdded(Element)

protected abstract void CheckElementCanBeAdded(Element element)

Parameters

element Element

CopyLayoutInformationFrom(View)

Attempts to copy the visual layout information (e.g. x,y coordinates) of elements and relationships from the specified source view into this view.

public void CopyLayoutInformationFrom(View source)

Parameters

source View

the source view

DisableAutomaticLayout()

Disables automatic layout for this view.

public void DisableAutomaticLayout()

EnableAutomaticLayout()

Enables automatic layout for this view, with some default settings.

public void EnableAutomaticLayout()

EnableAutomaticLayout(RankDirection, int, int, int, bool)

Enables the automatic layout for this view, with the specified settings.

public void EnableAutomaticLayout(RankDirection rankDirection, int rankSeparation, int nodeSeparation, int edgeSeparation, bool vertices)

Parameters

rankDirection RankDirection

the rank direction

rankSeparation int

the separation between ranks (in pixels, a positive integer)

nodeSeparation int

the separation between nodes within the same rank (in pixels, a positive integer)

edgeSeparation int

the separation between edges (in pixels, a positive integer)

vertices bool

whether vertices should be created during automatic layout

GetElementView(Element)

Gets the element view for the given element.

public ElementView GetElementView(Element element)

Parameters

element Element

the Element to find the ElementView for

Returns

ElementView

The matching ElementView.

Exceptions

InvalidOperationException

Thrown when the element is not present in the view.

GetRelationshipView(Relationship)

Gets the relationship view for the given relationship.

public RelationshipView GetRelationshipView(Relationship relationship)

Parameters

relationship Relationship

the Relationship to find the RelationshipView for

Returns

RelationshipView

The matching RelationshipView.

Exceptions

InvalidOperationException

Thrown when the relationship is not present in the view.

Remove(Relationship)

Removes the supplied relationship from the view when it is present.

public void Remove(Relationship relationship)

Parameters

relationship Relationship

The relationship to remove.

RemoveElement(Element)

protected void RemoveElement(Element element)

Parameters

element Element