public string User { get { throw null; } }
public override bool Equals([System.Diagnostics.CodeAnalysis.NotNullWhen(true)] object? value) { throw null; }
public override int GetHashCode() { throw null; }
- public static bool TryCreate(string address, [System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] out MailAddress? result) { throw null; }
- public static bool TryCreate(string address, string? displayName, [System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] out MailAddress? result) { throw null; }
- public static bool TryCreate(string address, string? displayName, System.Text.Encoding? displayNameEncoding, [System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] out MailAddress? result) { throw null; }
+ public static bool TryCreate([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] string? address, [System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] out MailAddress? result) { throw null; }
+ public static bool TryCreate([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] string? address, string? displayName, [System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] out MailAddress? result) { throw null; }
+ public static bool TryCreate([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] string? address, string? displayName, System.Text.Encoding? displayNameEncoding, [System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] out MailAddress? result) { throw null; }
public override string ToString() { throw null; }
}
public partial class MailAddressCollection : System.Collections.ObjectModel.Collection<System.Net.Mail.MailAddress>
/// <param name="address">A <see cref="string"/> that contains an email address.</param>
/// <param name="result">When this method returns, contains the <see cref="MailAddress"/> instance if address parsing succeed</param>
/// <returns>A <see cref="bool"/> value that is true if the <see cref="MailAddress"/> was successfully created; otherwise, false.</returns>
- public static bool TryCreate(string address, [NotNullWhen(true)] out MailAddress? result) => TryCreate(address, displayName: null, out result);
+ public static bool TryCreate([NotNullWhen(true)] string? address, [NotNullWhen(true)] out MailAddress? result) => TryCreate(address, displayName: null, out result);
/// <summary>
/// Create a new <see cref="MailAddress"/>. Does not throw an exception if the MailAddress cannot be created.
/// <param name="displayName">A <see cref="string"/> that contains the display name associated with address. This parameter can be null.</param>
/// <param name="result">When this method returns, contains the <see cref="MailAddress"/> instance if address parsing succeed</param>
/// <returns>A <see cref="bool"/> value that is true if the <see cref="MailAddress"/> was successfully created; otherwise, false.</returns>
- public static bool TryCreate(string address, string? displayName, [NotNullWhen(true)] out MailAddress? result) => TryCreate(address, displayName, displayNameEncoding: null, out result);
+ public static bool TryCreate([NotNullWhen(true)] string? address, string? displayName, [NotNullWhen(true)] out MailAddress? result) => TryCreate(address, displayName, displayNameEncoding: null, out result);
/// <summary>
/// Create a new <see cref="MailAddress"/>. Does not throw an exception if the MailAddress cannot be created.
/// <param name="displayNameEncoding">The <see cref="Encoding"/> that defines the character set used for displayName</param>
/// <param name="result">When this method returns, contains the <see cref="MailAddress"/> instance if address parsing succeed</param>
/// <returns>A <see cref="bool"/> value that is true if the <see cref="MailAddress"/> was successfully created; otherwise, false.</returns>
- public static bool TryCreate(string address, string? displayName, Encoding? displayNameEncoding, [NotNullWhen(true)] out MailAddress? result)
+ public static bool TryCreate([NotNullWhen(true)] string? address, string? displayName, Encoding? displayNameEncoding, [NotNullWhen(true)] out MailAddress? result)
{
if (TryParse(address, displayName, displayNameEncoding,
- out (string displayName, string user, string host, Encoding displayNameEncoding) parsed,
- throwExceptionIfFail: false))
+ out (string displayName, string user, string host, Encoding displayNameEncoding) parsed,
+ throwExceptionIfFail: false))
{
result = new MailAddress(parsed.displayName, parsed.user, parsed.host, parsed.displayNameEncoding);
return true;
}
}
- private static bool TryParse(string address, string? displayName, Encoding? displayNameEncoding, out (string displayName, string user, string host, Encoding displayNameEncoding) parsedData, bool throwExceptionIfFail)
+ private static bool TryParse([NotNullWhen(true)] string? address, string? displayName, Encoding? displayNameEncoding, out (string displayName, string user, string host, Encoding displayNameEncoding) parsedData, bool throwExceptionIfFail)
{
if (throwExceptionIfFail)
{