Table of Contents

Class Field

Namespace
EpNet
Assembly
EpNet.dll

Field class represent a field in an idf object. It implements methods for getting/setting numeric or string values.

Value property refers to the string representation of the field but if the field is numeric it can also be retrieved as a double variable using the Number property.

public class Field
Inheritance
Field
Extension Methods

Constructors

Field(IdfObject, int)

public Field(IdfObject idfObject, int index)

Parameters

idfObject IdfObject
index int

Properties

Comment

The comment associated to the field (represented as !- comment at the right of the value)

public string Comment { get; set; }

Property Value

string

Comment text

Name

Official field name (from E+ IDD)

public string Name { get; }

Property Value

string

Number

When the field is numeric, gets/sets its value as a double variable.

public double Number { get; set; }

Property Value

double

Numeric (double) value of the field.

UpperCase

Returns field string value in uppercase.

public string UpperCase { get; }

Property Value

string

Field in uppercase

Value

Get/sets field string value.

public string Value { get; set; }

Property Value

string

Field string value.

Methods

Contains(string)

Returns a value indicating whether a specified substring occurs within the string value of the field.

public bool Contains(string value)

Parameters

value string

Substring to be searched within the field.

Returns

bool

True if field contains substring. False otherwise.

ContainsIgnoreCase(string)

Returns a value indicating whether a specified substring occurs within the string value of the field. Case is ignored.

public bool ContainsIgnoreCase(string value)

Parameters

value string

Substring to be searched within the field.

Returns

bool

True if field contains substring. False otherwise.

ContainsIgnoreCase(params string[])

Determines whether any of the specified substrings occurs within this string.

public bool ContainsIgnoreCase(params string[] values)

Parameters

values string[]

Search substrings.

Returns

bool

true if current string contains search substring.

EndsWith(string)

Determines whether the end of the string value of the field matches the specified substring.

public bool EndsWith(string value)

Parameters

value string

Substring to be searched at the end of the field.

Returns

bool

True if field ends in the substring. False otherwise.

Equals(Field)

Determines whether this instance string value and a specified string, have the same value.

public bool Equals(Field field)

Parameters

field Field

The field to compare.

Returns

bool

true if the string value of this instance is the same as field string value; otherwise, false.

Equals(double)

Determines whether this instance numeric value and a specified number, have the same value.

public bool Equals(double num)

Parameters

num double

The number to compare.

Returns

bool

true if the numeric value of this instance is the same as num; otherwise, false.

Equals(object)

public override bool Equals(object obj)

Parameters

obj object

Returns

bool

Equals(string)

Determines whether this instance string value and a specified string, have the same value.

public bool Equals(string str)

Parameters

str string

The string to compare.

Returns

bool

true if the string value of this instance is the same as str; otherwise, false.

IsNumber()

Determines whether the field is numeric or not.

public bool IsNumber()

Returns

bool

true if the field is numeric; otherwise, false.

Match(string)

Returns the first IdfObject from the supplied class whose first field matches this field

public IdfObject Match(string idfClass)

Parameters

idfClass string

IdfClass to search for

Returns

IdfObject

Matching idfobject

Set(double)

Sets the value of the parameter as a double

public void Set(double number)

Parameters

number double

Numeric (double) value of the field.

Set(string)

Sets the value of the parameter as a string

public void Set(string value)

Parameters

value string

StartsWith(string)

Determines whether the beginning of the string value of the field matches the specified substring.

public bool StartsWith(string value)

Parameters

value string

Substring to be searched at the start of the field.

Returns

bool

True if field begins with the substring. False otherwise.

Operators

operator ==(Field, Field)

Determines whether a field string value and a specified field string value, are equal (case-insensitive).

public static bool operator ==(Field a, Field b)

Parameters

a Field

The first field to compare

b Field

The second field to compare.

Returns

bool

true if the string value of field a is the same as the string value of b field; otherwise, false.

operator ==(Field, double)

Determines whether a field numeric value equals a specified number.

public static bool operator ==(Field a, double b)

Parameters

a Field

The field to compare

b double

The double to compare.

Returns

bool

true if the numeric value of field a is the same as b; otherwise, false.

operator ==(Field, string)

Determines whether a field string value and a specified string, have the same value.

public static bool operator ==(Field a, string b)

Parameters

a Field

The field to compare

b string

The string to compare.

Returns

bool

true if the string value of field a is the same as b string; otherwise, false.

operator !=(Field, Field)

Determines whether a field string value and a specified field string value, are different (case-insensitive).

public static bool operator !=(Field a, Field b)

Parameters

a Field

The first field to compare

b Field

The second field to compare.

Returns

bool

true if the string value of field a is different than the string value of b field; otherwise, false.

operator !=(Field, double)

Determines whether a field numeric value equals a specified number..

public static bool operator !=(Field a, double b)

Parameters

a Field

The field to compare

b double

The double to compare.

Returns

bool

true if the numeric value of field a is different than b; otherwise, false.

operator !=(Field, string)

Determines whether a field string value and a specified string, are different.

public static bool operator !=(Field a, string b)

Parameters

a Field

The field to compare

b string

The string to compare.

Returns

bool

true if the string value of field a is different than b string; otherwise, false.