public void Visit(BeginCancellationPolicy instruction) { executeInstruction(() => { var name = instruction.Name.Resolve(_services).ToString(); if (!_registry.HasPolicy(name)) { throw new ModelMapException("Could not find cancellation policy: \"{0}\"".ToFormat(name)); } var type = _registry.FindPolicy(name); if (!type.CanBeCastTo <CancellationPolicy>()) { throw new ModelMapException("\"{0}\" does not inherit from CancellationPolicy".ToFormat(name)); } _transform = (IMappingTransform)FastYetSimpleTypeActivator.CreateInstance(_registry.FindPolicy(name)); }); }
public void Visit(BeginCancellationPolicy instruction) { }