Пример #1
0
        static void Main(string[] args)
        {
            MySingletonClass inst = MySingletonClass.Instance;

            inst.Count++;
            inst.ShowCount("Main()");
            foo(inst);
            inst.ShowCount("Main()");

            MySingletonClass newInstance = MySingletonClass.Instance;

            newInstance.ShowCount("Main() -> newInstance");
        }
Пример #2
0
 static void foo(MySingletonClass localInst)
 {
     localInst.ShowCount("foo()");
     localInst.Count += 25;
 }