Table of Contents

Class LogixType

Namespace
L5Sharp
Assembly
L5Sharp.dll

The base class for all logix type classes, which represent the value or data structure of a logix tag component.

public abstract class LogixType : ILogixSerializable
Inheritance
LogixType
Implements
Derived
Inherited Members

Remarks

This class exposes the common data type properties, such as Name, Family, Class, and Members. This class also provides common implicit conversions between .NET base types and LogixType classes so that the tag values may be set in a concise way.

Properties

Class

The class (atomic, predefined, user-defined) that the type belongs to.

public abstract DataTypeClass Class { get; }

Property Value

DataTypeClass

A DataTypeClass option representing the class type.

See Also

Family

The family (string or none) of the type.

public abstract DataTypeFamily Family { get; }

Property Value

DataTypeFamily

A DataTypeFamily option representing the family value.

See Also

Members

The collection of LogixMember objects that make up the structure of the type.

public abstract IEnumerable<LogixMember> Members { get; }

Property Value

IEnumerable<LogixMember>

A IEnumerable<T> containing LogixMember objects.

Remarks

All logix types, with the exception of a BOOL and REAL/LREAL, have what can be considered members. Every derived type must implement this property for which it returns a collection of members, forming the type/member hierarchy of the logix type.

See Also

Name

The name of the logix type.

public abstract string Name { get; }

Property Value

string

A string name identifying the logix type.

See Also

Methods

As<TLogixType>()

Casts the LogixType to the type of the generic parameter.

public TLogixType As<TLogixType>() where TLogixType : LogixType

Returns

TLogixType

The logix type object casted as the specified generic type parameter.

Type Parameters

TLogixType

The logix type to cast to.

Exceptions

InvalidCastException

The object can not be casted to the specified type.

See Also

Clone()

Returns a new deep cloned instance of the current type.

public LogixType Clone()

Returns

LogixType

A new instance of the specified logix type with the same property values.

Remarks

This method will simply deserialize a new instance using the current underlying element data.

Exceptions

InvalidOperationException

The object being cloned does not have a constructor accepting a single XElement argument.

See Also

Equals(object?)

Determines whether the specified object is equal to the current object.

public override bool Equals(object? obj)

Parameters

obj object

The object to compare with the current object.

Returns

bool

true if the specified object is equal to the current object; otherwise, false.

See Also

GetHashCode()

Serves as the default hash function.

public override int GetHashCode()

Returns

int

A hash code for the current object.

See Also

Member(string)

Gets a LogixMember with the specified name if it exists for the LogixType; Otherwise, returns null.

public LogixMember? Member(string name)

Parameters

name string

The name of the member to get.

Returns

LogixMember

A LogixMember with the specified name if found; Otherwise, null.

Remarks

This performs a case insensitive comparison for the member name.

See Also

RaiseDataChanged(object)

Raising the DataChanged event for the type with the provided object sender.

protected void RaiseDataChanged(object sender)

Parameters

sender object

The objet initiating the data changed event. This could be this object, or a descendent member or type in the data hierarchy.

See Also

Serialize()

Returns a XElement representing the serialized L5X data for a given object.

public abstract XElement Serialize()

Returns

XElement

A XElement containing the XML data.

See Also

ToString()

Returns a string that represents the current object.

public override string ToString()

Returns

string

A string that represents the current object.

See Also

Events

DataChanged

An event that triggers when the LogixType members collection changes.

public event EventHandler? DataChanged

Event Type

EventHandler

Remarks

This event is allowing us to detect when the value of a immediate or nested logix type changes. This is important for tag so that it can know when to update the underlying XML data structure represented by the in-memory data structure.

See Also

Operators

operator ==(LogixType, LogixType)

Determines whether the LogixType values are equal.

public static bool operator ==(LogixType left, LogixType right)

Parameters

left LogixType

An logix type to compare.

right LogixType

An logix type to compare.

Returns

bool

true if the objects are equal, otherwise, false.

See Also

operator >(LogixType, LogixType)

Compares two objects and determines if a is greater than b.

public static bool operator >(LogixType a, LogixType b)

Parameters

a LogixType

An logix type to compare.

b LogixType

An logix type to compare.

Returns

bool

true if a is greater than b, otherwise, false.

See Also

operator >=(LogixType, LogixType)

Compares two objects and determines if a is greater or equal to than b.

public static bool operator >=(LogixType a, LogixType b)

Parameters

a LogixType

An logix type to compare.

b LogixType

An logix type to compare.

Returns

bool

true if a is greater than or equal to b, otherwise, false.

See Also

implicit operator LogixType(LogixType[,,])

Converts the provided Array to a LogixType.

public static implicit operator LogixType(LogixType[,,] value)

Parameters

value LogixType[,,]

The value to convert.

Returns

LogixType

A LogixType representing the converted value.

See Also

implicit operator LogixType(LogixType[,])

Converts the provided Array to a LogixType.

public static implicit operator LogixType(LogixType[,] value)

Parameters

value LogixType[,]

The value to convert.

Returns

LogixType

A LogixType representing the converted value.

See Also

implicit operator LogixType(LogixType[])

Converts the provided Array to a LogixType.

public static implicit operator LogixType(LogixType[] value)

Parameters

value LogixType[]

The value to convert.

Returns

LogixType

A LogixType representing the converted value.

See Also

implicit operator LogixType(bool)

Converts the provided bool to a LogixType.

public static implicit operator LogixType(bool value)

Parameters

value bool

The value to convert.

Returns

LogixType

A LogixType representing the converted value.

See Also

implicit operator LogixType(byte)

Converts the provided byte to a LogixType.

public static implicit operator LogixType(byte value)

Parameters

value byte

The value to convert.

Returns

LogixType

A LogixType representing the converted value.

See Also

implicit operator LogixType(Dictionary<string, LogixType>)

Converts the provided Dictionary<TKey, TValue> to a LogixType.

public static implicit operator LogixType(Dictionary<string, LogixType> value)

Parameters

value Dictionary<string, LogixType>

The value to convert.

Returns

LogixType

A LogixType representing the converted value.

See Also

implicit operator LogixType(double)

Converts the provided double to a LogixType.

public static implicit operator LogixType(double value)

Parameters

value double

The value to convert.

Returns

LogixType

A LogixType representing the converted value.

See Also

implicit operator LogixType(short)

Converts the provided short to a LogixType.

public static implicit operator LogixType(short value)

Parameters

value short

The value to convert.

Returns

LogixType

A LogixType representing the converted value.

See Also

implicit operator LogixType(int)

Converts the provided int to a LogixType.

public static implicit operator LogixType(int value)

Parameters

value int

The value to convert.

Returns

LogixType

A LogixType representing the converted value.

See Also

implicit operator LogixType(long)

Converts the provided long to a LogixType.

public static implicit operator LogixType(long value)

Parameters

value long

The value to convert.

Returns

LogixType

A LogixType representing the converted value.

See Also

implicit operator LogixType(sbyte)

Converts the provided sbyte to a LogixType.

public static implicit operator LogixType(sbyte value)

Parameters

value sbyte

The value to convert.

Returns

LogixType

A LogixType representing the converted value.

See Also

implicit operator LogixType(float)

Converts the provided float to a LogixType.

public static implicit operator LogixType(float value)

Parameters

value float

The value to convert.

Returns

LogixType

A LogixType representing the converted value.

See Also

implicit operator LogixType(string)

Converts the provided string to a LogixType.

public static implicit operator LogixType(string value)

Parameters

value string

The value to convert.

Returns

LogixType

A LogixType representing the converted value.

See Also

implicit operator LogixType(ushort)

Converts the provided ushort to a LogixType.

public static implicit operator LogixType(ushort value)

Parameters

value ushort

The value to convert.

Returns

LogixType

A LogixType representing the converted value.

See Also

implicit operator LogixType(uint)

Converts the provided uint to a LogixType.

public static implicit operator LogixType(uint value)

Parameters

value uint

The value to convert.

Returns

LogixType

A LogixType representing the converted value.

See Also

implicit operator LogixType(ulong)

Converts the provided ulong to a LogixType.

public static implicit operator LogixType(ulong value)

Parameters

value ulong

The value to convert.

Returns

LogixType

A LogixType representing the converted value.

See Also

operator !=(LogixType, LogixType)

Determines whether the LogixType values are not equal.

public static bool operator !=(LogixType left, LogixType right)

Parameters

left LogixType

An logix type to compare.

right LogixType

An logix type to compare.

Returns

bool

true if the objects are not equal, otherwise, false.

See Also

operator <(LogixType, LogixType)

Compares two objects and determines if a is less than b.

public static bool operator <(LogixType a, LogixType b)

Parameters

a LogixType

An logix type to compare.

b LogixType

An logix type to compare.

Returns

bool

true if a is less than b, otherwise, false.

See Also

operator <=(LogixType, LogixType)

Compares two objects and determines if a is less than or equal to b.

public static bool operator <=(LogixType a, LogixType b)

Parameters

a LogixType

An logix type to compare.

b LogixType

An logix type to compare.

Returns

bool

true if a is less than or equal to b, otherwise, false.

See Also

See Also