/// <summary> /// Used by derived classes to copy the base class state to a new /// instance as well as configure the new connection's SSH and SCP /// clients. /// </summary> /// <param name="target">The target proxy.</param> protected void CloneTo(LinuxSshProxy <TMetadata> target) { Covenant.Requires <ArgumentNullException>(target != null, nameof(target)); base.CloneTo(target); target.Metadata = this.Metadata; }
/// <summary> /// Returns a clone of the SSH proxy. This can be useful for situations where you /// need to be able to perform multiple SSH/SCP operations against the same /// machine in parallel. /// </summary> /// <returns>The cloned <see cref="LinuxSshProxy{TMetadata}"/>.</returns> public new LinuxSshProxy <TMetadata> Clone() { var clone = new LinuxSshProxy <TMetadata>(Name, Address, credentials); CloneTo(clone); return(clone); }