File: dotnet03.cs - Tab length: 1 2 4 8 - Lines: on off - No wrap: on off


class MaClasse
{
 private Modifier<int> modifier;
 private int    counter;

 public MaClasse ()
 {
  this.modifier = new Modifier<int> (this.counter);
  this.counter = 3;
 }

 public void  Test ()
 {
  Console.WriteLine ("avant: " + this.counter); // devrait afficher "avant: 3"

  this.modifier.SetValue (12);

  Console.WriteLine ("apr�s: " + this.counter); // devrait afficher "apr�s: 12"
 }
}

class Modifier<T>
{
 // attributs ?
 private /*FIXME*/ myRef;

 public Modifier (ref T myVar)
 {
  myRef = /*FIXME*/;
 }

 public void SetValue (T value)
 {
  this.myRef = value;
 }
}