Class LogixMember
- Namespace
- L5Sharp
- Assembly
- L5Sharp.dll
A component of a LogixType that defines the structure or hierarchy of the type.
public class LogixMember : ILogixSerializable
- Inheritance
-
LogixMember
- Implements
- Inherited Members
Remarks
Members are used to define the structure of other LogixType objects. Since each member holds a strongly typed reference to it's data type, the structure forms a hierarchical tree of nested members and types.
This class can deserialize elements such as DataValueMember, StructureMember, and ArrayMember, as well as the root Data element and even the Tag elements. This class makes use of LogixData for deserialization. This class only defines, name and data type, since Dimension, Radix, and ExternalAccess are all either members or the specific LogixType, or not inherent in the data structure when serialized or deserialized.
LogixMember also contains an event called DataChanged which triggers when DataType is set. It also subscribes to the data change event of DataType in order to route events up the type/member hierarchy. This allows the root member to notify of a change so subscribers (Tag) can update the L5X.
Constructors
LogixMember(string?, LogixType?)
Creates a new LogixMember object with the provided name and logix type.
public LogixMember(string? name, LogixType? type)
Parameters
name
stringThe name of the member. If
null
will default to an empty string.type
LogixTypeThe LogixType representing the member's data. If
null
will default to NullType.
LogixMember(XElement)
Creates a new LogixMember initialized from the provided XElement data.
public LogixMember(XElement element)
Parameters
element
XElementThe element to parse as the new member object.
Exceptions
- ArgumentNullException
element
is null.- InvalidOperationException
element
does not have required attributes or child elements.
Properties
DataType
The logix type of the LogixMember.
public LogixType DataType { get; set; }
Property Value
Remarks
The data type creates property the hierarchical structure of complex types. This type can be atomic, structure, string, or array.
Exceptions
- ArgumentNullException
value
is null.
Name
The name of the LogixMember.
public string Name { get; }
Property Value
Remarks
Member name can represent the member name, array element index name, or tag name of an L5X element.
Methods
Serialize()
Returns a XElement representing the serialized L5X data for a given object.
public XElement Serialize()
Returns
Events
DataChanged
An event that triggers when the DataType property changes or is set.
public event EventHandler? DataChanged
Event Type
Remarks
This event is allowing us to detect when the value of a immediate or nested logix type member 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.