Skip to content

Commit

Permalink
Converted tabs to spaces that were introduced by mistake.
Browse files Browse the repository at this point in the history
  • Loading branch information
rmboggs committed Dec 12, 2011
1 parent ce2fce9 commit 2e5127a
Show file tree
Hide file tree
Showing 2 changed files with 66 additions and 66 deletions.
122 changes: 61 additions & 61 deletions src/NAnt.Core/Tasks/MailTask.cs
Expand Up @@ -120,8 +120,8 @@ public class MailTask : Task {
[TaskAttribute("replyto")]
public string ReplyTo
{
get { return _replyTo; }
set { _replyTo = value; }
get { return _replyTo; }
set { _replyTo = value; }
}

/// <summary>
Expand Down Expand Up @@ -325,15 +325,15 @@ public MailFormat Format
if (!String.IsNullOrEmpty(ReplyTo))
{
#if NET_4_0
MailAddressCollection replyAddrs = ParseAddresses(ReplyTo);
if (replyAddrs.Count > 0) {
foreach (MailAddress replyAddr in replyAddrs) {
mailMessage.ReplyToList.Add(replyAddr);
}
}
MailAddressCollection replyAddrs = ParseAddresses(ReplyTo);
if (replyAddrs.Count > 0) {
foreach (MailAddress replyAddr in replyAddrs) {
mailMessage.ReplyToList.Add(replyAddr);
}
}
#else
mailMessage.ReplyTo = ConvertStringToMailAddress(ReplyTo);
mailMessage.ReplyTo = ConvertStringToMailAddress(ReplyTo);
#endif
}

Expand Down Expand Up @@ -535,57 +535,57 @@ private MailAddress ConvertStringToMailAddress(string address)

// String array containing all of the regex strings used to
// locate the email address in the parameter string.
string[] validators = new string[]
{
// Format: Full Name <address@abcxyz.com>
@"^(?<fullname>.+)\s<(?<email>[^<>\(\)\s]+@[^<>\(\)\s]+\.[^<>\(\)\s]+)>$",
// Format: <address@abcxyz.com> Full Name
@"^<(?<email>[^<>\(\)\s]+@[^<>\(\)\s]+\.[^\s]+)>\s(?<fullname>.+)$",
// Format: (Full Name) address@abcxyz.com
@"^\((?<fullname>.+)\)\s(?<email>[^<>\(\)\s]+@[^<>\(\)\s]+\.[^<>\(\)\s]+)$",
// Format: address@abcxyz.com (Full Name)
@"^(?<email>[^<>\(\)\s]+@[^<>\(\)\s]+\.[^\s]+)\s\((?<fullname>.+)\)$",
// Format: address@abcxyz.com
@"(?<email>[^<>\(\)\s]+@[^<>\(\)\s]+\.[^<>\(\)\s]+)"
};
// Loop through each regex string to find the one that the
// email address matches.
foreach (string reg in validators)
{
// Create the regex object and try to match
// the email address with the current regex
// string.
Regex currentRegex = new Regex(reg);
Match email = currentRegex.Match(escAddress);
// If the match is considered successful, return
// a new MailAddress object. If a name was
// paired with an email address in the parameter,
// add it to the MailAddress object that is returned.
if (email.Success)
{
if (email.Groups["fullname"].Success)
{
return new MailAddress(
email.Groups["email"].Value.Trim(),
email.Groups["fullname"].Value.Trim());
}
return new MailAddress(email.Groups["email"].Value.Trim());
}
}
// If none of the regex strings matches the address parameter,
// throw a build exception.
throw new BuildException(
String.Format(CultureInfo.InvariantCulture,
"{0} is not a recognized email address",
address));
string[] validators = new string[]
{
// Format: Full Name <address@abcxyz.com>
@"^(?<fullname>.+)\s<(?<email>[^<>\(\)\s]+@[^<>\(\)\s]+\.[^<>\(\)\s]+)>$",
// Format: <address@abcxyz.com> Full Name
@"^<(?<email>[^<>\(\)\s]+@[^<>\(\)\s]+\.[^\s]+)>\s(?<fullname>.+)$",
// Format: (Full Name) address@abcxyz.com
@"^\((?<fullname>.+)\)\s(?<email>[^<>\(\)\s]+@[^<>\(\)\s]+\.[^<>\(\)\s]+)$",
// Format: address@abcxyz.com (Full Name)
@"^(?<email>[^<>\(\)\s]+@[^<>\(\)\s]+\.[^\s]+)\s\((?<fullname>.+)\)$",
// Format: address@abcxyz.com
@"(?<email>[^<>\(\)\s]+@[^<>\(\)\s]+\.[^<>\(\)\s]+)"
};
// Loop through each regex string to find the one that the
// email address matches.
foreach (string reg in validators)
{
// Create the regex object and try to match
// the email address with the current regex
// string.
Regex currentRegex = new Regex(reg);
Match email = currentRegex.Match(escAddress);
// If the match is considered successful, return
// a new MailAddress object. If a name was
// paired with an email address in the parameter,
// add it to the MailAddress object that is returned.
if (email.Success)
{
if (email.Groups["fullname"].Success)
{
return new MailAddress(
email.Groups["email"].Value.Trim(),
email.Groups["fullname"].Value.Trim());
}
return new MailAddress(email.Groups["email"].Value.Trim());
}
}
// If none of the regex strings matches the address parameter,
// throw a build exception.
throw new BuildException(
String.Format(CultureInfo.InvariantCulture,
"{0} is not a recognized email address",
address));
}

#endregion Private Instance Methods
Expand Down
10 changes: 5 additions & 5 deletions src/NAnt.Core/Util/StringUtils.cs
Expand Up @@ -172,11 +172,11 @@ public sealed class StringUtils {
/// </returns>
public static string HtmlDecode(string value)
{
return value.Replace("&quot;", "\"")
.Replace("&amp;", "&")
.Replace("&apos;", "'")
.Replace("&lt;", "<")
.Replace("&gt;", ">");
return value.Replace("&quot;", "\"")
.Replace("&amp;", "&")
.Replace("&apos;", "'")
.Replace("&lt;", "<")
.Replace("&gt;", ">");
}

#endregion Public Static Methods
Expand Down

0 comments on commit 2e5127a

Please sign in to comment.