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
unitUnitThe unit.
Exceptions
- ArgumentNullException
unitis 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
keystringThe key (placeholder name) of the element to get or set.
Property Value
- string
The element with the specified key (placeholder name).
Exceptions
- ArgumentNullException
keyis null.- KeyNotFoundException
The property is retrieved and
keyis 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
itemKeyValuePair<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
keystringThe object to use as the key (placeholder name) of the element to add.
valuestringThe 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
itemKeyValuePair<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
keystringThe 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
keyis 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
arrayKeyValuePair<string, string>[]The one-dimensional Array that is the destination of the elements copied from UnitPlaceholdersDictionary. The Array must have zero-based indexing.
arrayIndexintThe zero-based index in
arrayat 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
itemKeyValuePair<string, string>The object to remove from the UnitPlaceholdersDictionary.
Returns
- bool
true if
itemwas successfully removed from the UnitPlaceholdersDictionary; otherwise, false. This method also returns false ifitemis 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
keystringThe 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
keywas 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
keystringThe key (placeholder name) whose value to get.
valuestringWhen this method returns, the value associated with the specified key, if the key is found; otherwise, the default value for the type of the
valueparameter. This parameter is passed uninitialized.
Returns
- bool
true if the UnitPlaceholdersDictionary contains an element with the specified key; otherwise, false.
Exceptions
- ArgumentNullException
keyis null.