Table of Contents

Class CodeElement

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

Represents a code element, such as a class or interface, that is part of the implementation of a component.

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

Constructors

CodeElement(string)

Creates a CodeElement based upon the fully qualified name provided.

public CodeElement(string fullyQualifiedTypeName)

Parameters

fullyQualifiedTypeName string

A fully qualified type name

Fields

Name

The simple type name of the code element.

[DataMember(Name = "name", EmitDefaultValue = false)]
public readonly string Name

Field Value

string

Type

The fully qualified type name of the code element.

[DataMember(Name = "type", EmitDefaultValue = false)]
public readonly string Type

Field Value

string

Properties

Category

The category of code element; e.g. class, interface, etc.

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

Property Value

string

Description

A short description of the code element's responsibility.

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

Property Value

string

Language

The programming language used to create the code element.

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

Property Value

string

Role

The role of the code element ... Primary or Supporting.

[DataMember(Name = "role", EmitDefaultValue = true)]
public CodeElementRole Role { get; }

Property Value

CodeElementRole

Size

The size of the code element; e.g. the number of lines.

[DataMember(Name = "size", EmitDefaultValue = true)]
public long Size { get; set; }

Property Value

long

Url

A URL; e.g. a reference to the code element in source code control.

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

Property Value

string

Visibility

The visibility of the code element; e.g. public, package, private.

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

Property Value

string

Methods

Equals(CodeElement)

Compares this code element with another code element by fully qualified type name.

public bool Equals(CodeElement other)

Parameters

other CodeElement

The code element to compare with.

Returns

bool

true when both code elements represent the same type; otherwise, false.

Equals(object)

Compares this code element with another object.

public override bool Equals(object obj)

Parameters

obj object

The object to compare with.

Returns

bool

true when obj is a matching CodeElement; otherwise, false.

GetHashCode()

Returns a hash code derived from the fully qualified type name.

public override int GetHashCode()

Returns

int

A hash code for the current code element.