Mono Class Library: System.Version Overview | Members

System.Version.Clone Method

Returns a new object with values equal to the property values of the current instance. [Edit]

public object Clone ()

Returns

A new object whose values are equal to the property values of the current instance. [Edit]

Remarks

The object returned by this method must be explicitly cast to a Version before it can be used as one.

Note: This method is implemented to support the ICloneable interface.

[Edit]

Example

The following example clones the version number and writes the result to the console.

C# Example
using System;
class VersionCloneExample {
  public static void Main() {
    Version vers = new Version("6.1.2.4");
    Console.WriteLine("The string representation of the" +
                      " version is {0}.",
                      vers.ToString());
    Version clone = (Version) vers.Clone();
    Console.WriteLine("The original version was" +
                      " successfully cloned.");
    Console.Write("The string representation of the" +
                  " cloned version is {0}.",
                  clone.ToString());
  }
}
   

The output is

The string representation of the version is 6.1.2.4.
The original version was successfully cloned.
The string representation of the cloned version is 6.1.2.4.

Requirements

Namespace: System
Assembly: mscorlib (in mscorlib.dll)
Assembly Versions: 1.0.5000.0, 2.0.0.0