Parameter.Clone Yöntem

Tanım

Geçerli Parameter örneğin bir kopyasını döndürür.

protected:
 virtual System::Web::UI::WebControls::Parameter ^ Clone();
protected virtual System.Web.UI.WebControls.Parameter Clone ();
abstract member Clone : unit -> System.Web.UI.WebControls.Parameter
override this.Clone : unit -> System.Web.UI.WebControls.Parameter
Protected Overridable Function Clone () As Parameter

Döndürülenler

Parameter

Parameter Geçerli olanın tam yinelemesi olan.

Örnekler

Aşağıdaki kod örneği, sınıfı için Parameter(Parameter) doğru nesne kopyalama davranışını uygulamak üzere sınıfını genişleten Parameter bir sınıftan oluşturucunun nasıl çağrıldığını gösterir. Bu kod örneği, sınıfı için Parameter sağlanan daha büyük bir örneğin parçasıdır.

// The StaticParameter copy constructor is provided to ensure that
// the state contained in the DataValue property is copied to new
// instances of the class.
protected StaticParameter(StaticParameter original) : base(original) {
  DataValue = original.DataValue;
}

// The Clone method is overridden to call the
// StaticParameter copy constructor, so that the data in
// the DataValue property is correctly transferred to the
// new instance of the StaticParameter.
protected override Parameter Clone() {
  return new StaticParameter(this);
}
' The StaticParameter copy constructor is provided to ensure that
' the state contained in the DataValue property is copied to new
' instances of the class.
Protected Sub New(original As StaticParameter)
   MyBase.New(original)
   DataValue = original.DataValue
End Sub

' The Clone method is overridden to call the
' StaticParameter copy constructor, so that the data in
' the DataValue property is correctly transferred to the
' new instance of the StaticParameter.
Protected Overrides Function Clone() As Parameter
   Return New StaticParameter(Me)
End Function

Açıklamalar

yöntemi, Clone geçerli örneğin değerleriyle sınıfının yeni bir örneğini Parameter başlatmak için kopya oluşturucuyu çağırırParameter(Parameter).

sınıfını Parameter genişletirseniz, türetilmiş sınıfınızın yeni bir örneğine kopyalanması gereken herhangi bir durumu eklemek için yöntemini geçersiz kılabilirsiniz Clone .

Şunlara uygulanır

Ayrıca bkz.