コード例 #1
0
ファイル: Program.cs プロジェクト: pawel54321/Wyklad-Sample
        static void Main(string[] args)
        {
            ICommandFactory factory = new StandardCommandFactory();

            ICommand cmd = factory.CreateChangeUserPasswordCmd(2, "stare hasło", "nowe hasło");

            cmd.Execute();

            Console.WriteLine();

            factory = new AdvancedCommandFactory();
            cmd     = factory.CreateChangeUserPasswordCmd(2, "stare hasło", "nowe hasło");

            cmd.Execute();
        }
コード例 #2
0
ファイル: Program.cs プロジェクト: daviid1922/Wyklad-Sample
        static void Main(string[] args)
        {
            ICommand cmd = new ChangeUserPassowrdCmd(2, "qwerty123", "QWERTY1234");

            ICommandFactory factory = new StandardCommandFactory();


            cmd = factory.CreateCommand(cmd);
            cmd.Execute();

            Console.WriteLine();

            factory = new AdvancedCommandFactory();
            cmd     = factory.CreateCommand(cmd);

            cmd.Execute();
        }