/Files/wenjie/WindowsFormsApplication3.rar
Program.cs
Code
Code
HttpServiceWatcher.cs
Code
IFailureNotifier
Code
AlarmFailureNotifier
Code
EmailFailureNotifier
Code
Form1.cs
Code
Code
${}就是服务所查找调用的
传递一系列的notifiers给HttpServiceWatcher
假设你不满意HttpServiceWatcher只是接收一个notifier的实例。好的,那么我们就让它接收一个notifiers数组
public class HttpServiceWatcher { private IFailureNotifier[] notifiers; private string url = "default url"; public HttpServiceWatcher(IFailureNotifier[] notifiers) { this.notifiers = notifiers; } ...
<component id="httpservicewatcher" type="GettingStartedPart1.HttpServiceWatcher, GettingStartedPart1"> <parameters> <notifiers> <array> <item>${email.notifier}</item> <item>${alarm.notifier}</item> </array> </notifiers> <Url>different url</Url> </parameters> </component>