Parameter.Clone 메서드

정의

현재 Parameter 인스턴스의 복제본을 반환합니다.

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

반환

Parameter

현재 개체와 완전히 동일한 Parameter입니다.

예제

다음 코드 예제를 호출 하는 방법에 설명 합니다 Parameter(Parameter) 확장 하는 클래스의 생성자는 Parameter 클래스에 대 한 동작을 복제 하는 올바른 개체를 구현 하는 클래스입니다. 이 코드 예제는에 대해 제공 된 큰 예제의 일부는 Parameter 클래스입니다.

// 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

설명

합니다 Clone 메서드 호출을 Parameter(Parameter) 의 새 인스턴스를 초기화 하는 복사 생성자는 Parameter 현재 인스턴스의 값을 사용 하 여 클래스입니다.

확장 하는 경우는 Parameter 재정의할 수 있습니다 클래스는 Clone 파생된 클래스의 새 인스턴스를 복사 해야 하는 모든 상태를 포함 하는 방법입니다.

적용 대상

추가 정보