|
|
@@ -55,8 +55,8 @@ namespace BPASmartClient.S7Net |
|
|
|
numBytes += len; |
|
|
|
break; |
|
|
|
default: |
|
|
|
if (type.IsClass) numBytes += 2.0; |
|
|
|
numBytes = GetClassSize(Activator.CreateInstance(type), numBytes, isInnerProperty: true); |
|
|
|
if (type.IsClass) IncrementToEven(ref numBytes); |
|
|
|
break; |
|
|
|
} |
|
|
|
|
|
|
@@ -219,7 +219,12 @@ namespace BPASmartClient.S7Net |
|
|
|
break; |
|
|
|
default: |
|
|
|
{ |
|
|
|
if (propertyType.IsClass) numBytes += 2; |
|
|
|
//if (propertyType.IsClass) numBytes += 2; |
|
|
|
numBytes = Math.Ceiling(numBytes); |
|
|
|
if (numBytes / 2.0 - Math.Floor(numBytes / 2.0) > 0.0) |
|
|
|
{ |
|
|
|
numBytes += 1.0; |
|
|
|
} |
|
|
|
object obj2 = Activator.CreateInstance(propertyType); |
|
|
|
numBytes = FromBytes(obj2, bytes, numBytes); |
|
|
|
obj = obj2; |
|
|
@@ -337,8 +342,8 @@ namespace BPASmartClient.S7Net |
|
|
|
} |
|
|
|
break; |
|
|
|
default: |
|
|
|
if (propertyValue.GetType().IsClass) numBytes += 2; |
|
|
|
numBytes = ToBytes(propertyValue, bytes, numBytes); |
|
|
|
//if (propertyValue.GetType().IsClass) IncrementToEven(ref numBytes); |
|
|
|
break; |
|
|
|
} |
|
|
|
|
|
|
|