使用序列化反序列化深度克隆一个对象,该对象需要支持序列化特性
Cloning an object with serialization deserialization depth that requires support for serialization attributes
命名空间:
HslCommunication.BasicFramework
程序集:
HslCommunication (在 HslCommunication.dll 中) 版本:12.1.2.0 (12.1.2.0)
语法 public static Object DeepClone(
Object oringinal
)
Public Shared Function DeepClone (
oringinal As Object
) As Object
public:
static Object^ DeepClone(
Object^ oringinal
)
static member DeepClone :
oringinal : Object -> Object
参数
- oringinal
- 类型:SystemObject
源对象,支持序列化
返回值
类型:
Object新的一个实例化的对象
异常 异常 | 条件 |
---|
NullReferenceException | |
NonSerializedAttribute | |
备注 警告: |
---|
oringinal 参数必须实现序列化的特性
|
示例 SystemVersion version1 = new SystemVersion( "1.2.3" );
SystemVersion version2 = (SystemVersion)SoftBasic.DeepClone( version1 );
参见