예제 #1
0
        // Define a one-to-many dependency between objects so that when one object changes state, all
        // its dependents are notified and updated automatically.
        public static void Main(string[] _)
        {
            var mohammad = new JobSeeker("Mohammad");
            var ali      = new JobSeeker("Ali");

            var developer = new JobPosting();

            developer.Subscribe(mohammad);
            developer.Subscribe(ali);

            developer.AddJob(new JobPost(".Net Developer"));
            developer.AddJob(new JobPost("Java Developer"));

            Console.ReadKey();
        }
예제 #2
0
파일: Program.cs 프로젝트: N0rtus/Patterns
        public static void Main(string[] args)
        {
            var soheil = new JobSeeker("Soheil");
            var ali    = new JobSeeker("Ali");

            var jobPosting = new JobPosting();

            jobPosting.Subscribe(soheil);
            jobPosting.Subscribe(ali);

            jobPosting.AddJob(new JobPost(".NET Developer"));
            jobPosting.AddJob(new JobPost("Java Developer"));

            Console.ReadKey();
        }