static void Main(string[] args) { int result = TestTool.GetInstance().Add(1, 2); Console.WriteLine("OVER"); Console.ReadLine(); }
// 定义单例模式将PolicyInjection.Create<UserOperation>()产生的这个对象传出去,这样就避免了在调用处写这些东西 public static TestTool GetInstance() { if (oUserOpertion == null) { oUserOpertion = PolicyInjection.Create <TestTool>(); } return(oUserOpertion); }