Class UnitPlaceholdersDictionary
- Namespace
- Acuit.Pinpoint.Workstation.LabelPrinting
- Assembly
- Acuit.Pinpoint.Workstation.Interfaces.dll
A dictionary that holds standard unit placeholders for use with label print definitions. For each dictionary element, the key is the placeholder name, and the value is the replacement value.
public class UnitPlaceholdersDictionary : IDictionary<string, string>, ICollection<KeyValuePair<string, string>>, IReadOnlyDictionary<string, string>, IReadOnlyCollection<KeyValuePair<string, string>>, IEnumerable<KeyValuePair<string, string>>, IEnumerable
- Inheritance
-
UnitPlaceholdersDictionary
- Implements
- Inherited Members
Remarks
The dictionary will contain the following placeholders:
Placeholder Name | Replacement Value |
---|---|
unitSerialNumber |
The unit serial number, for stations that work with units. |
unitModelNumber |
The unit model number. |
unitModelNumberAlias |
The unit model number alias. |
unitProductionGroupName |
The unit production group name, from the production schedule. |
unitSequenceNumber |
The unit sequence number, from the production schedule. |
assemblySerialNumber |
The assembly serial number, for stations that work with assemblies. |
assemblyModelNumber |
The assembly model number, for stations that work with assemblies. |
scheduleName |
The production schedule name. (This is deprecrated and will be removed in a future version; unitProductionGroupName should be used instead.) |
The dictionary reflects changes to the Unit provided to the constructor that occur after constructing an instance of this class.
Constructors
UnitPlaceholdersDictionary(Unit)
Initializes a new instance of the UnitPlaceholdersDictionary class.
public UnitPlaceholdersDictionary(Unit unit)
Parameters
unit
UnitThe unit.
Exceptions
- ArgumentNullException
unit
is null.
Properties
Count
Gets the number of elements contained in the UnitPlaceholdersDictionary.
public int Count { get; }
Property Value
IsReadOnly
Gets a value indicating whether the UnitPlaceholdersDictionary is read-only.
public bool IsReadOnly { get; }
Property Value
this[string]
Gets or sets the element with the specified key (placeholder name).
public string this[string key] { get; set; }
Parameters
key
stringThe key (placeholder name) of the element to get or set.
Property Value
- string
The element with the specified key (placeholder name).
Exceptions
- ArgumentNullException
key
is null.- KeyNotFoundException
The property is retrieved and
key
is not found.- NotSupportedException
The property is set and the UnitPlaceholdersDictionary is read-only.
Keys
Gets a collection containing the keys (placeholder names) of the UnitPlaceholdersDictionary.
public ICollection<string> Keys { get; }
Property Value
Values
Gets a collection containing the values (replacement values) in the UnitPlaceholdersDictionary.
public ICollection<string> Values { get; }
Property Value
Methods
Add(KeyValuePair<string, string>)
Adds an item to the UnitPlaceholdersDictionary.
public void Add(KeyValuePair<string, string> item)
Parameters
item
KeyValuePair<string, string>The object to add to the UnitPlaceholdersDictionary.
Exceptions
- NotSupportedException
The UnitPlaceholdersDictionary is read-only.
Add(string, string)
Adds an element with the provided key (placeholder name) and value (replacement value) to the UnitPlaceholdersDictionary.
public void Add(string key, string value)
Parameters
key
stringThe object to use as the key (placeholder name) of the element to add.
value
stringThe object to use as the value (replacement value) of the element to add.
Exceptions
- NotSupportedException
The UnitPlaceholdersDictionary is read-only.
Clear()
Removes all items from the UnitPlaceholdersDictionary.
public void Clear()
Exceptions
- NotSupportedException
The UnitPlaceholdersDictionary is read-only.
Contains(KeyValuePair<string, string>)
Determines whether the UnitPlaceholdersDictionary contains a specific value.
public bool Contains(KeyValuePair<string, string> item)
Parameters
item
KeyValuePair<string, string>The object to locate in the UnitPlaceholdersDictionary.
Returns
- bool
true if item is found in the UnitPlaceholdersDictionary; otherwise, false.
ContainsKey(string)
Determines whether the UnitPlaceholdersDictionary contains an element with the specified key (placeholder name).
public bool ContainsKey(string key)
Parameters
key
stringThe key (placeholder name) to locate in the UnitPlaceholdersDictionary.
Returns
- bool
true if the UnitPlaceholdersDictionary contains an element with the key (placeholder name); otherwise, false.
Exceptions
- ArgumentNullException
key
is null.
CopyTo(KeyValuePair<string, string>[], int)
Copies the elements of the UnitPlaceholdersDictionary to an Array, starting at a particular Array index.
public void CopyTo(KeyValuePair<string, string>[] array, int arrayIndex)
Parameters
array
KeyValuePair<string, string>[]The one-dimensional Array that is the destination of the elements copied from UnitPlaceholdersDictionary. The Array must have zero-based indexing.
arrayIndex
intThe zero-based index in
array
at which copying begins.
Exceptions
- NotImplementedException
This method is not implemented.
GetEnumerator()
Returns an enumerator that iterates through the collection.
public IEnumerator<KeyValuePair<string, string>> GetEnumerator()
Returns
- IEnumerator<KeyValuePair<string, string>>
An enumerator that can be used to iterate through the collection.
Remove(KeyValuePair<string, string>)
Removes the first occurrence of a specific object from the UnitPlaceholdersDictionary.
public bool Remove(KeyValuePair<string, string> item)
Parameters
item
KeyValuePair<string, string>The object to remove from the UnitPlaceholdersDictionary.
Returns
- bool
true if
item
was successfully removed from the UnitPlaceholdersDictionary; otherwise, false. This method also returns false ifitem
is not found in the original UnitPlaceholdersDictionary.
Exceptions
- NotSupportedException
The UnitPlaceholdersDictionary is read-only.
Remove(string)
Removes the element with the specified key (placeholder name) from the UnitPlaceholdersDictionary.
public bool Remove(string key)
Parameters
key
stringThe key (placeholder name) of the element to remove.
Returns
- bool
true if the element is successfully removed; otherwise, false. This method also returns false if
key
was not found in the original UnitPlaceholdersDictionary.
Exceptions
- NotSupportedException
The UnitPlaceholdersDictionary is read-only.
TryGetValue(string, out string)
Gets the value associated with the specified key (placeholder name).
public bool TryGetValue(string key, out string value)
Parameters
key
stringThe key (placeholder name) whose value to get.
value
stringWhen this method returns, the value associated with the specified key, if the key is found; otherwise, the default value for the type of the
value
parameter. This parameter is passed uninitialized.
Returns
- bool
true if the UnitPlaceholdersDictionary contains an element with the specified key; otherwise, false.
Exceptions
- ArgumentNullException
key
is null.