Class Vendor
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
ushortThe unique Id of the Vendor.
name
stringThe 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
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
Rockwell
Gets the Rockwell Automation Vendor instance (id=1).
public static Vendor Rockwell { get; }
Property Value
Unknown
Represents an Unknown Vendor with no id or name.
public static Vendor Unknown { get; }
Property Value
Methods
Equals(object?)
Determines whether the specified object is equal to the current object.
public override bool Equals(object? obj)
Parameters
obj
objectThe object to compare with the current object.
Returns
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
stringThe unique valid that identifies the Vendor.
Returns
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
Returns
- bool
true if the provided objects are equal; otherwise, false.
implicit operator ushort(Vendor)
public static implicit operator ushort(Vendor vendor)
Parameters
Returns
implicit operator Vendor(ushort)
public static implicit operator Vendor(ushort vendorId)
Parameters
Returns
operator !=(Vendor?, Vendor?)
Determines if the provided objects are not equal.
public static bool operator !=(Vendor? left, Vendor? right)
Parameters
Returns
- bool
true if the provided objects are not equal; otherwise, false.