public PatientApptManager() { _hospitalDB = new HospitalDBManager(); _smsDeliveryManager = new SMSDeliveryManager(); _emailDeliveryManager = new EmailDeliveryManager(); SMSDelegate smsDelegate = new SMSDelegate(_smsDeliveryManager.SendNotification); EmailDelegate emailDelegate = new EmailDelegate(_emailDeliveryManager.SendNotification); ApptCreatedSMS += smsDelegate; ApptCreatedEmail += emailDelegate; }
public static void Main() { // Instantiating the delegate --- step 2 EmailDelegate email = new EmailDelegate(Email.GetEmail); MessageDelegate msg = new MessageDelegate(Email.DisplayMessage); // Invoking delegate -- step 3 String strEmail = email.Invoke("*****@*****.**"); Console.WriteLine(strEmail); msg.Invoke(); Console.ReadKey(); }
public InfoView(CallDelegate callDelegate, EmailDelegate emailDelegate) { _infoLabel = ViewFactory.CreateUILabel(); _infoImage = new UIImageView(); _infoPhoneButton = UIButton.FromType(UIButtonType.Custom); _infoEmailButton = UIButton.FromType(UIButtonType.Custom); AddSubview(_infoImage); AddSubview(_infoLabel); AddSubview(_infoPhoneButton); AddSubview(_infoEmailButton); BackgroundColor = UIColor.White; _callDelegate = callDelegate; _emailDelegate = emailDelegate; _infoPhoneButton.TouchUpInside += InfoPhoneButton_TouchUpInside; _infoEmailButton.TouchUpInside += InfoEmailButton_TouchUpInside; }