浙林龙哥

   :: 首页  :: 新随笔  :: 联系 :: 订阅 订阅  :: 管理

[System.Runtime.Remoting.Contexts.Synchronization()]

public class Calc: ContextBoundObject
{
  public Calc()
  {
    Console.WriteLine("Calc(): " + Thread.CurrentContext);
  }

  public int Add(int x, int y)
  {
    Console.WriteLine("Add: " + Thread.CurrentContext);
    return x + y;
  }
}

 

public class Application
{
  public static void Main()
  {

    Console.WriteLine("Main: " + Thread.CurrentContext);

    Assert.AreEqual(3, new Calc().Add(1, 2));
  }

}


posted on 2005-08-12 10:24  浙林龙哥  阅读(324)  评论(0编辑  收藏  举报