Table of Contents

Class Vendor

Namespace
L5Sharp.Common
Assembly
L5Sharp.dll

An entity that represents the vendor of a given Module.

public class Vendor
Inheritance
Vendor
Inherited Members

Remarks

This object is a simple entity type wrapper that groups the vendor id and name. Vendor's are defined by Rockwell and assigned unique Id and name. Use Rockwell as it is the most common vendor for compatible devices.

Constructors

Vendor(ushort, string?)

Creates a new Vendor value with the provided id and name.

public Vendor(ushort id, string? name = null)

Parameters

id ushort

The unique Id of the Vendor.

name string

The name of the Vendor. Will default to empty if not provided.

Properties

Id

Gets the value that uniquely identifies the Vendor.

public ushort Id { get; }

Property Value

ushort

Remarks

This value is exported in the L5X and is used for Vendor name lookups.

Name

Gets the value that represents the Vendor name.

public string Name { get; }

Property Value

string

Rockwell

Gets the Rockwell Automation Vendor instance (id=1).

public static Vendor Rockwell { get; }

Property Value

Vendor

Unknown

Represents an Unknown Vendor with no id or name.

public static Vendor Unknown { get; }

Property Value

Vendor

Methods

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.

GetHashCode()

Serves as the default hash function.

public override int GetHashCode()

Returns

int

A hash code for the current object.

Parse(string)

Creates a new Vendor using the provided vendor Id.

public static Vendor Parse(string vendorId)

Parameters

vendorId string

The unique valid that identifies the Vendor.

Returns

Vendor

A new Vendor object with the provided Id.

ToString()

Returns a string that represents the current object.

public override string ToString()

Returns

string

A string that represents the current object.

Operators

operator ==(Vendor?, Vendor?)

Determines if the provided objects are equal.

public static bool operator ==(Vendor? left, Vendor? right)

Parameters

left Vendor

An object to compare.

right Vendor

An object to compare.

Returns

bool

true if the provided objects are equal; otherwise, false.

implicit operator ushort(Vendor)

Converts a Vendor object to a ushort that represents the Id.

public static implicit operator ushort(Vendor vendor)

Parameters

vendor Vendor

The Vendor object to convert.

Returns

ushort

A ushort representing the value of the Vendor Id.

implicit operator Vendor(ushort)

Converts a ushort value to a Vendor object that represents the Id.

public static implicit operator Vendor(ushort vendorId)

Parameters

vendorId ushort

The ushort value to convert.

Returns

Vendor

A Vendor with the Id of the converted value.

operator !=(Vendor?, Vendor?)

Determines if the provided objects are not equal.

public static bool operator !=(Vendor? left, Vendor? right)

Parameters

left Vendor

An object to compare.

right Vendor

An object to compare.

Returns

bool

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