/// <summary>Initializes a new instance of the <see cref="BackgroundCopyJobCredential"/> class.</summary>
 /// <param name="scheme">The scheme.</param>
 /// <param name="target">The target.</param>
 /// <param name="username">The user name.</param>
 /// <param name="password">The password.</param>
 public BackgroundCopyJobCredential(BackgroundCopyJobCredentialScheme scheme, BackgroundCopyJobCredentialTarget target, string username, string password)
 {
     Scheme   = scheme;
     Target   = target;
     UserName = username;
     Password = password;
 }
 /// <summary>Removes the specified scheme.</summary>
 /// <param name="scheme">The scheme.</param>
 /// <param name="target">The target.</param>
 /// <returns></returns>
 public bool Remove(BackgroundCopyJobCredentialScheme scheme, BackgroundCopyJobCredentialTarget target)
 {
     try
     {
         ijob2.RemoveCredentials((BG_AUTH_TARGET)target, (BG_AUTH_SCHEME)scheme);
         if (dict != null)
         {
             Values.Remove(MakeKey(scheme, target));
         }
         return(true);
     }
     catch
     {
         return(false);
     }
 }
 /// <summary>Gets the <see cref="BackgroundCopyJobCredential"/> with the specified scheme and target.</summary>
 /// <param name="scheme">The credential scheme.</param>
 /// <param name="target">The credential target.</param>
 /// <returns>The <see cref="BackgroundCopyJobCredential"/>.</returns>
 public BackgroundCopyJobCredential this[BackgroundCopyJobCredentialScheme scheme, BackgroundCopyJobCredentialTarget target] =>
 Values[MakeKey(scheme, target)];
 internal static uint MakeKey(BackgroundCopyJobCredentialScheme scheme, BackgroundCopyJobCredentialTarget target) => PInvoke.Macros.MAKELONG((ushort)scheme, (ushort)target);
 /// <summary>Adds the specified credential.</summary>
 /// <param name="scheme">The credential scheme.</param>
 /// <param name="target">The credential target.</param>
 /// <param name="username">The username.</param>
 /// <param name="password">The password.</param>
 public void Add(BackgroundCopyJobCredentialScheme scheme, BackgroundCopyJobCredentialTarget target, string username, string password)
 {
     Add(new BackgroundCopyJobCredential(scheme, target, username, password));
 }