Request() public method

public Request ( ) : void
return void
コード例 #1
0
        static void Main(string[] args)
        {
            Target target = new Target();

            target.Request();


            TargetAdapter targetAdapter = new TargetAdapter();

            targetAdapter.Request();
            Console.ReadKey();
        }
コード例 #2
0
        static void Main()
        {
            // Create adapter and call a request
            Target target = new Target();

            target.Request();

            // add Adapter and call SpecificRequest
            target = new Adapter();
            target.Request();

            // Wait for user
            Console.ReadKey();
        }
コード例 #3
0
ファイル: Program.cs プロジェクト: linuxchata/patterns
        public static void Main(string[] args)
        {
            var adapter = new StubAdapter();

            var renderer     = new DataRenderer(adapter);
            var stringWriter = new StringWriter();

            renderer.Render(stringWriter);
            Console.WriteLine(stringWriter.ToString());

            var connection  = new SqlCeConnection(@"Data Source=db.sdf");
            var command     = new SqlCeCommand("SELECT * FROM Pattern", connection);
            var dataAdapter = new SqlCeDataAdapter(command);

            renderer     = new DataRenderer(dataAdapter);
            stringWriter = new StringWriter();
            renderer.Render(stringWriter);
            Console.WriteLine(stringWriter.ToString());

            var list = new List <Pattern>
            {
                new Pattern {
                    Id = 1, Name = "Strategy"
                },
                new Pattern {
                    Id = 2, Name = "MVC"
                }
            };
            var patternRendered = new PatternRenderer();

            Console.WriteLine(patternRendered.PatternsList(list));

            Console.WriteLine("Simple adapter pattern");
            Target target = new Target();

            target.Request();

            var adaptee = new Adapter.SimpleAdapter.Adaptee();

            target = new Adapter.SimpleAdapter.Adapter(adaptee);
            target.Request();

            Console.ReadKey();
        }
コード例 #4
0
ファイル: Client.cs プロジェクト: azb101/design-patterns
 public void Request(Target target)
 {
     target.Request();
 }