Saxonite 1.2.11.12
This commit is contained in:
@@ -253,20 +253,19 @@ 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 (ItemId.Type >= 0 && ItemId.Type != data.ItemId.Type)
|
||||
throw new NotSupportedException(fn + " Item type cannot be changed");
|
||||
throw new NotSupportedException($"{SysUtil.Fn} Item type cannot be changed");
|
||||
if (SysId.IsValid(ItemId.Id) && SysId.ToInt(ItemId.Id) != SysId.ToInt(data.ItemId.Id))
|
||||
throw new NotSupportedException(fn + " Item Id cannot be changed");
|
||||
throw new NotSupportedException($"{SysUtil.Fn} Item Id cannot be changed");
|
||||
if (!StringUtil.IsEmpty(ExternalReference) && !ExternalReference.Equals(data.ExternalReference))
|
||||
throw new NotSupportedException(fn + " External reference cannot be changed");
|
||||
throw new NotSupportedException($"{SysUtil.Fn} External reference cannot be changed");
|
||||
// Populate individual properties to ensure that 'Changed' indicator is kept up to date.
|
||||
this.data.PopulateFrom(data);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user