适配器模式+AutoFac


适配器模式+AutoFac

    interface ICommand
    {
        void Excute();
    }
    class OpenCommand : ICommand
    {
        public void Excute()
        {
            Console.Write("this is Opened");
        }
    }
    class SaveCommand : ICommand
    {
        public void Excute()
        {
            Console.Write("this is Saved");
        }
    }
    class Button
    {
       private ICommand command;
        private string name;
        public Button(ICommand command, string name)
        {
            this.command = command;
            this.name = name;
        }

        public void Click()
        {
            command.Excute();
        }
        public void Print()
        {
            command.Excute();
            Console.WriteLine(" "+ name);
        }
    }

    class Editor
    {
        private IEnumerable