protected override object CreateInstance(CreationContext context, ConstructorCandidate constructor, object[] arguments) { object component = base.CreateInstance(context, constructor, arguments); if (arguments != null) { IWatchDogService watchDogService = arguments.FirstOrDefault(arg => arg is IWatchDogService) as IWatchDogService; if (watchDogService != null) { watchDogService.WatchingType = component.GetType(); } } return component; }
public WatchedClassViaConstructor(IWatchDogService watchDogService) { this.watchDogService = watchDogService; }