Delegate.Clone Método
Definição
Cria uma cópia superficial do delegado.Creates a shallow copy of the delegate.
public:
virtual System::Object ^ Clone();
public virtual object Clone ();
abstract member Clone : unit -> obj
override this.Clone : unit -> obj
Public Overridable Function Clone () As Object
Retornos
Uma cópia superficial do delegado.A shallow copy of the delegate.
Implementações
Comentários
O clone tem o mesmo Type , o destino, o método e a lista de invocação que o delegado original.The clone has the same Type, target, method, and invocation list as the original delegate.
Uma cópia superficial cria uma nova instância do mesmo tipo que o objeto original e, em seguida, copia os campos não estáticos do objeto original.A shallow copy creates a new instance of the same type as the original object, and then copies the nonstatic fields of the original object. Se o campo for um tipo de valor, uma cópia bit a bit do campo será executada.If the field is a value type, a bit-by-bit copy of the field is performed. Se o campo for um tipo de referência, a referência será copiada, mas o objeto referido não será; Portanto, a referência no objeto original e a referência no ponto de clonagem para o mesmo objeto.If the field is a reference type, the reference is copied but the referred object is not; therefore, the reference in the original object and the reference in the clone point to the same object. Por outro lado, uma cópia profunda de um objeto duplica tudo que é referenciado direta ou indiretamente pelos campos no objeto.In contrast, a deep copy of an object duplicates everything directly or indirectly referenced by the fields in the object.