/// <summary> /// Initializes a new instance of the <see cref="AuthenticationResponseSnapshot"/> class. /// </summary> /// <param name="copyFrom">The authentication response to copy from.</param> internal AuthenticationResponseSnapshot(IAuthenticationResponse copyFrom) { ErrorUtilities.VerifyArgumentNotNull(copyFrom, "copyFrom"); this.ClaimedIdentifier = copyFrom.ClaimedIdentifier; this.FriendlyIdentifierForDisplay = copyFrom.FriendlyIdentifierForDisplay; this.Status = copyFrom.Status; this.callbackArguments = copyFrom.GetCallbackArguments(); }
internal AuthenticationResponseSnapshot(IAuthenticationResponse copyFrom) { if (copyFrom == null) { throw new ArgumentNullException("copyFrom"); } ClaimedIdentifier = copyFrom.ClaimedIdentifier; FriendlyIdentifierForDisplay = copyFrom.FriendlyIdentifierForDisplay; Status = copyFrom.Status; callbackArguments = copyFrom.GetCallbackArguments(); }
/// <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; } }