static void Main(string[] args) { Prototype prototype = new PrototypeImpl(1000); for (int i = 1; i < 10; i++) { var tempotype = (Prototype)prototype.Clone(); // Usage of values in prototype to derive a new value. tempotype.X = tempotype.X * i; tempotype.PrintX(); } Console.ReadKey(); }
private static void Main(string[] args) { Prototype prototype = new PrototypeImpl(); prototype.Content = "some content"; Prototype copy = prototype.Clone(); Console.WriteLine(copy.Content); prototype.Content = "changed content"; Console.WriteLine(copy.Content); Prototype copy1 = prototype.Clone(); Console.WriteLine(copy1.Content); Console.WriteLine("press <enter> to exit"); Console.ReadLine(); }
static void Main(string[] args) { Prototype prototype = new PrototypeImpl(1000); for (int i = 1; i < 10; i++) { var tempotype = (Prototype)prototype.Clone(); // Usage of values in prototype to derive a new value. tempotype.X = tempotype.X * i; tempotype.PrintX(); } Console.ReadKey(); }