public static void EX1()
        {
            IComponent simpleComponent = new Component();
            simpleComponent.Operation();

            IComponent complexComponent = new Composite.Exemplo1.Composite();
            complexComponent.Operation();

            Composite.Exemplo1.Composite composite = new Exemplo1.Composite();
            composite.AddComponent(simpleComponent);
            composite.AddComponent(complexComponent);

            composite.GetComponents();
            composite.Operation2();
        }
示例#2
0
        public static void EX1()
        {
            IComponent simpleComponent = new Component();

            simpleComponent.Operation();

            IComponent complexComponent = new Composite.Exemplo1.Composite();

            complexComponent.Operation();

            Composite.Exemplo1.Composite composite = new Exemplo1.Composite();
            composite.AddComponent(simpleComponent);
            composite.AddComponent(complexComponent);

            composite.GetComponents();
            composite.Operation2();
        }