Saxonite 1.2.11.12

This commit is contained in:
Andy Howard
2024-08-20 17:51:51 +01:00
parent 12aa285f32
commit 2eb778ac17
36 changed files with 149 additions and 121 deletions
@@ -203,18 +203,17 @@ namespace Sarand.Net.Standard.Base.Interfaces
public Data GetData () { return data.Clone(); }
public void SetData (Data data)
{
String fn = GetType().Name + ".SetData";
// Properties that cannot be changed if previously specified.
if (SysId.IsValid(Id) && SysId.ToInt(Id) != SysId.ToInt(data.Id))
throw new NotSupportedException(fn + " Id cannot be changed");
throw new NotSupportedException($"{SysUtil.Fn} Id cannot be changed");
if (SysId.IsValid(InterfaceId) && SysId.ToInt(InterfaceId) != SysId.ToInt(data.InterfaceId))
throw new NotSupportedException(fn + " Interface cannot be changed");
throw new NotSupportedException($"{SysUtil.Fn} Interface cannot be changed");
if ((int)Direction > 0 && (int)Direction != (int)data.Direction)
throw new NotSupportedException(fn + " Direction cannot be changed");
throw new NotSupportedException($"{SysUtil.Fn} Direction cannot be changed");
if (!StringUtil.IsEmpty(Reference) && !Reference.Equals(data.Reference))
throw new NotSupportedException(fn + " Reference cannot be changed");
throw new NotSupportedException($"{SysUtil.Fn} Reference cannot be changed");
if (Sequence > 0 && Sequence != data.Sequence)
throw new NotSupportedException(fn + " Sequence cannot be changed");
throw new NotSupportedException($"{SysUtil.Fn} Sequence cannot be changed");
// Populate individual properties to ensure that 'Changed' indicator is kept up to date.
this.data.PopulateFrom(data);
}