- using System;
- using System.Collections.Generic;
- using System.Text;
- namespace ConsoleApplication1
- {
- class Facade
- {
- private Func1 field1;
- private Func2 field2;
- public Facade()
- {
- field1 = new Func1();
- field2 = new Func2();
- }
- public void Method()
- {
- field1.Method();
- field1.Method1();
- field2.Method();
- }
- public void Method1()
- {
- field2.Method();
- field2.Method1();
- field1.Method();
- }
- }
- class Func1
- {
- public void Method()
- {
- Console.WriteLine("功能类1的方法1");
- }
- public void Method1()
- {
- Console.WriteLine("功能类1的方法2");
- }
- }
- internal class Func2
- {
- public void Method()
- {
- Console.WriteLine("功能类2的方法1");
- }
- public void Method1()
- {
- Console.WriteLine("功能类2的方法2");
- }
- }
- class Client
- {
- public static void Main()
- {
- Facade f = new Facade();
- f.Method();
- f.Method1();
- Console.Read();
- }
- }
- }