public void AddImportedDelegate(ActivityDelegate importedDelegate, object origin) { ThrowIfDisposed(); ActivityUtilities.ValidateOrigin(origin, _activity); if (importedDelegate != null) { _activity.AddImportedDelegate(importedDelegate); if (importedDelegate.Handler != null && importedDelegate.Handler.CacheId != _activity.CacheId) { importedDelegate.Handler.Origin = origin; } // We don't currently have ActivityDelegate.Origin. If we ever add it, or if we ever // expose Origin publicly, we need to also set it here. } }