예제 #1
0
        public static void TryEvents()
        {
            SiteScannerPublisher siteScanner = new SiteScannerPublisher();
            Subscriber1          subscriber1 = new Subscriber1(siteScanner);
            Subscriber2          subscriber2 = new Subscriber2(siteScanner);

            Console.WriteLine($"Publisherul invoca un event! info: Android site changed");
            siteScanner.OnAndroidSiteChanged();

            Console.WriteLine($"Publisherul invoca un event! info CN site chaged");
            siteScanner.OnCNSiteChanged();
        }
 public Subscriber1(SiteScannerPublisher siteScannerPublisher)
 {
     SiteScannerPublisher = siteScannerPublisher;
     siteScannerPublisher.SiteChangedEvent += OnSiteChangedHandler;
 }