Value Class
The TcHmiSrv.Value class was moved from the TcHmiSrv to the TcHmiSrv.Core namespace. It was therefore replaced by the Value class.
Differences between this release
- Value implements ICopyableT, IDictionaryTKey, TValue, IReadOnlyDictionaryTKey, TValue, IListT, IConvertible and IEquatableT.
- The Value.Value(Value) constructor was removed. Use the ValueDeepCopy method instead.
- The Value.Value(ValueType) constructor was removed. Set the ValueType instead.
- The ValueValue(Byte), ValueValue(SByte), ValueValue(Char), ValueValue(Decimal), ValueValue(Int16), ValueValue(UInt16), ValueValue(UInt32), ValueValue(UInt64), ValueValue(Single), ValueValue(IEnumerableValue) and ValueValue(IDictionaryString, Value) constructors were added.
- The Value.IsSet property was removed. Check for null instead to determine if the Value is set or check if ValueType equals ValueTypeNull to determine if the Value represents null like in JSON.
- The Value.Empty property was replaced by ValueIsEmpty.
- The Value.Size property was replaced by ValueCount.
- The Value.Begin, Value.BeginVector, Value.End and Value.EndVector properties were removed. Please take a look at How to migrate to see how they can be replaced in your TwinCAT HMI server extension.
- The Value.Item(Int32) property throws a ArgumentOutOfRangeException instead of returning an empty Value if the index is not a valid index in the Value.
- The Value.Item(String) property throws a KeyNotFoundException instead of returning an empty Value if the key is not found in the Value.
- The Value.convert(ValueType) method was removed. Use an overload of the ConvertChangeType methods to convert an instance of type Value to another Type.
- The ValueAddRange(IEnumerableValue) method was added.
- The Value.add(Value) method was replaced by ValueAdd(Value).
- The Value.clear() method was replaced by ValueClear.
- The Value.find(String) method was removed. Use the ValueItemString indexer instead.
- The Value.find(UInt32) method was removed. Use the ValueItemInt32 indexer instead.
- The Value.insert(String,String) method was removed. Use the ValueAdd(String, Value) method instead.
- The Value.insert(String, Value) method was replaced by ValueAdd(String, Value).
- The Value.insert(ValueVectorIterator, Value) method was replaced by ValueInsert(Int32, Value).
- The Value.insert_or_update(String, String) method was removed. Use the ValueAddOrUpdate(String, Value) method instead.
- The Value.insert_or_update(String, Value) method was replaced by ValueAddOrUpdate(String, Value).
- The Value.remove(UInt32) method was replaced by ValueRemoveAt(Int32).
- The Value.remove(ValueIterator) method was replaced by ValueRemove(String).
- The Value.remove(ValueVectorIterator) method was removed. Use the ValueRemoveAt(Int32) method instead.
- The Value.remove(UInt32, UInt32) method was replaced by ValueRemoveRange(Int32, Int32). Please note the different meaning of the second parameters.
- The Value.reserve(UInt32) method was replaced by ValueCapacity.
- The Value.set(Boolean) method was replaced by ValueSetValue(Boolean).
- The Value.set(Double) method was replaced by ValueSetValue(Double).
- The Value.set(Int32) method was replaced by ValueSetValue(Int32).
- The Value.set(Int64) method was replaced by ValueSetValue(Int64).
- The Value.set(String) method was replaced by ValueSetValue(String).
- The Value.set(Access) method was replaced by ValueSetValue(Access).
- The Value.set(Alarm) method was replaced by ValueSetValue(Alarm).
- The Value.set(Binary) method was replaced by ValueSetValue(Byte).
- The Value.set(Event) method was replaced by ValueSetValue(Event).
- The Value.set(Message) method was replaced by ValueSetValue(Message).
- The Value.set(Severity) method was replaced by ValueSetValue(Severity).
- The Value.set(Timespan) method was replaced by ValueSetValue(TimeSpan).
- The Value.set(Timestamp) method was replaced by ValueSetValue(DateTime).
- The Value.set(ValueType) method was removed.
- The ValueSetValue(Byte), ValueSetValue(SByte), ValueSetValue(Char), ValueSetValue(Decimal), ValueSetValue(Int16), ValueSetValue(UInt16), ValueSetValue(UInt32), ValueSetValue(UInt64) and ValueSetValue(Single) methods were added.
- The Value.swap(Value) method was removed.
- The Value (Decimal to Value) and Value (Value to Decimal) implicit conversion operators were added.