示例#1
0
 /// <summary>
 /// 代理或转发请求
 /// </summary>
 public void Request()
 {
     PreRequest();
     if (realSubject == null)
         realSubject = new RealSubject();
     realSubject.Request();//代理转发
     PostRequest();
 }
示例#2
0
文件: ProxyTest.cs 项目: chengn/DPRun
        public static void Test()
        {
            Console.WriteLine("==============================Proxy Test==================================");

            //使用代理
            Subject proxySubject = new ProxySubject();
            proxySubject.Request();

            //不使用代理
            Subject realSubject = new RealSubject();
            realSubject.Request();
        }