ByteStreamMessageEncodingBindingElement.Clone 方法

定义

创建一个从当前对象初始化的新 ByteStreamMessageEncodingBindingElement 对象。Creates a new ByteStreamMessageEncodingBindingElement object initialized from the current one.

public:
 override System::ServiceModel::Channels::BindingElement ^ Clone();
public override System.ServiceModel.Channels.BindingElement Clone ();
override this.Clone : unit -> System.ServiceModel.Channels.BindingElement
Public Overrides Function Clone () As BindingElement

返回

BindingElement

一个绑定元素,其属性值等于当前元素的属性值。A binding element with property values equal to those of the current element.

注解

这将创建当前绑定元素对象树的完整副本,也称为深层克隆。This creates a complete copy of the current binding element object tree, also called a deep clone. 对象的深层克隆创建对象的副本以及该对象直接或间接引用的所有内容的副本。A deep clone of an object creates a copy of the object and a copy of everything directly or indirectly referenced by that object. 这也被描述为复制整个对象图。This can also be described as copying the entire object graph. 通过返回深层克隆,运行时将能够支持多个自定义绑定共用一个自定义绑定元素的情况。Returning a deep clone enables the runtime to support the case in which multiple custom bindings share a custom binding element. 如果未返回深层克隆,则运行时行为将不可确定。If a deep clone is not returned, the runtime behavior is undefined.

相比之下,对象的浅表克隆只是对象本身的副本。A shallow clone of an object, by contrast, is a copy of the object only. 如果对象包含对其他对象的引用,则浅表复制不创建所引用对象的副本,而是仅复制对原始对象的引用。If the object contains references to other objects, the shallow copy does not create copies of the referred objects; instead, it copies only the references to the original objects.

适用于