/// <summary> /// Initializes a new instance of the <see cref="PositiveAuthenticationResponseSnapshot"/> class. /// </summary> /// <param name="copyFrom">The authentication response to copy from.</param> internal PositiveAuthenticationResponseSnapshot(IAuthenticationResponse copyFrom) { Contract.Requires <ArgumentNullException>(copyFrom != null); this.ClaimedIdentifier = copyFrom.ClaimedIdentifier; this.FriendlyIdentifierForDisplay = copyFrom.FriendlyIdentifierForDisplay; this.Status = copyFrom.Status; this.Provider = copyFrom.Provider; this.untrustedCallbackArguments = copyFrom.GetUntrustedCallbackArguments(); // Do this special check to avoid logging a warning for trying to clone a dictionary. var anonResponse = copyFrom as PositiveAnonymousResponse; if (anonResponse == null || anonResponse.TrustedCallbackArgumentsAvailable) { this.callbackArguments = copyFrom.GetCallbackArguments(); } else { this.callbackArguments = EmptyDictionary <string, string> .Instance; } }