Value Class
The TcHmiSrv.Value class was moved from the TcHmiSrv to the TcHmiSrv.Core namespace. It was therefore replaced by the TcHmiSrv.Core.Value class.
Differences between this release
- TcHmiSrv.Core.Value implements TcHmiSrv.Core.Duplication.ICopyable.T., System.Collections.Generic.IDictionary.TKey, TValue., System.Collections.Generic.IReadOnlyDictionary.TKey, TValue., System.Collections.Generic.IList.T., System.IConvertible and System.IEquatable.T..
- The Value.Value(Value) constructor was removed. Use the Value.DeepCopy. method instead.
- The Value.Value(ValueType) constructor was removed. Set the Value.Type instead.
- The Value.Value(Byte), Value.Value(SByte), Value.Value(Char), Value.Value(Decimal), Value.Value(Int16), Value.Value(UInt16), Value.Value(UInt32), Value.Value(UInt64), Value.Value(Single), Value.Value(IEnumerable.Value.) and Value.Value(IDictionary.String, Value.) constructors were added.
- The Value.IsSet property was removed. Check for null instead to determine if the TcHmiSrv.Core.Value is set or check if Value.Type equals ValueType.Null to determine if the TcHmiSrv.Core.Value represents null like in JSON.
- The Value.Empty property was replaced by Value.IsEmpty.
- The Value.Size property was replaced by Value.Count.
- 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 System.ArgumentOutOfRangeException instead of returning an empty TcHmiSrv.Core.Value if the index is not a valid index in the TcHmiSrv.Core.Value.
- The Value.Item(String) property throws a System.Collections.Generic.KeyNotFoundException instead of returning an empty TcHmiSrv.Core.Value if the key is not found in the TcHmiSrv.Core.Value.
- The Value.convert(ValueType) method was removed. Use an overload of the Convert.ChangeType methods to convert an instance of type TcHmiSrv.Core.Value to another System.Type.
- The Value.AddRange(IEnumerable.Value.) method was added.
- The Value.add(Value) method was replaced by Value.Add(Value).
- The Value.clear() method was replaced by Value.Clear..
- The Value.find(String) method was removed. Use the Value.Item.String. indexer instead.
- The Value.find(UInt32) method was removed. Use the Value.Item.Int32. indexer instead.
- The Value.insert(String,String) method was removed. Use the Value.Add(String, Value) method instead.
- The Value.insert(String, Value) method was replaced by Value.Add(String, Value).
- The Value.insert(ValueVectorIterator, Value) method was replaced by Value.Insert(Int32, Value).
- The Value.insert_or_update(String, String) method was removed. Use the Value.AddOrUpdate(String, Value) method instead.
- The Value.insert_or_update(String, Value) method was replaced by Value.AddOrUpdate(String, Value).
- The Value.remove(UInt32) method was replaced by Value.RemoveAt(Int32).
- The Value.remove(ValueIterator) method was replaced by Value.Remove(String).
- The Value.remove(ValueVectorIterator) method was removed. Use the Value.RemoveAt(Int32) method instead.
- The Value.remove(UInt32, UInt32) method was replaced by Value.RemoveRange(Int32, Int32). Please note the different meaning of the second parameters.
- The Value.reserve(UInt32) method was replaced by Value.Capacity.
- The Value.set(Boolean) method was replaced by Value.SetValue(Boolean).
- The Value.set(Double) method was replaced by Value.SetValue(Double).
- The Value.set(Int32) method was replaced by Value.SetValue(Int32).
- The Value.set(Int64) method was replaced by Value.SetValue(Int64).
- The Value.set(String) method was replaced by Value.SetValue(String).
- The Value.set(Access) method was replaced by Value.SetValue(Access).
- The Value.set(Alarm) method was replaced by Value.SetValue(Alarm).
- The Value.set(Binary) method was replaced by Value.SetValue(.Byte.).
- The Value.set(Event) method was replaced by Value.SetValue(Event).
- The Value.set(Message) method was replaced by Value.SetValue(Message).
- The Value.set(Severity) method was replaced by Value.SetValue(Severity).
- The Value.set(Timespan) method was replaced by Value.SetValue(TimeSpan).
- The Value.set(Timestamp) method was replaced by Value.SetValue(DateTime).
- The Value.set(ValueType) method was removed.
- The Value.SetValue(Byte), Value.SetValue(SByte), Value.SetValue(Char), Value.SetValue(Decimal), Value.SetValue(Int16), Value.SetValue(UInt16), Value.SetValue(UInt32), Value.SetValue(UInt64) and Value.SetValue(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.