共用方式為


BindingContext.Clone 方法

定義

傳回目前通道建置內容的複本。

public:
 System::ServiceModel::Channels::BindingContext ^ Clone();
public System.ServiceModel.Channels.BindingContext Clone ();
member this.Clone : unit -> System.ServiceModel.Channels.BindingContext
Public Function Clone () As BindingContext

傳回

BindingContext 物件,它是目前通道建置內容的複本。

範例

CustomBinding binding = new CustomBinding();
BindingParameterCollection bpCol = new BindingParameterCollection();
BindingContext context = new BindingContext(binding, bpCol);
BindingContext clonedContext = context.Clone();
Dim binding As New CustomBinding()
Dim bpCol As New BindingParameterCollection()
Dim context As New BindingContext(binding, bpCol)
Dim clonedContext As BindingContext = context.Clone()

備註

這個方法會傳回一個複本,此複本是繫結內容的深層複製品。 物件的深層複製會建立物件的複本,以及該物件直接或間接參考之每個物件的複本, (這也稱為複製整個物件圖形。) 相較之下,對象的淺層複製只是對象的複本。 如果物件包含其他物件的參考,則淺層複製不會建立所參考之物件的複本,而只會複製原始物件的參考。

適用於