Move IsValidEmail from program- to setup controller
This commit is contained in:
parent
3536b626d4
commit
989472802e
|
@ -1155,16 +1155,6 @@ namespace SparkleShare {
|
|||
}
|
||||
|
||||
|
||||
// Checks to see if an email address is valid
|
||||
public bool IsValidEmail (string email)
|
||||
{
|
||||
Regex regex = new Regex (@"^[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,4}$", RegexOptions.IgnoreCase);
|
||||
return regex.IsMatch (email);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
public void AddNoteToFolder (string folder_name, string revision, string note)
|
||||
{
|
||||
folder_name = folder_name.Replace ("%20", " ");
|
||||
|
@ -1177,8 +1167,6 @@ namespace SparkleShare {
|
|||
}
|
||||
|
||||
|
||||
|
||||
|
||||
private string [] tango_palette = new string [] {"#eaab00", "#e37222",
|
||||
"#3892ab", "#33c2cb", "#19b271", "#9eab05", "#8599a8", "#9ca696",
|
||||
"#b88454", "#cc0033", "#8f6678", "#8c6cd0", "#796cbf", "#4060af",
|
||||
|
|
|
@ -18,6 +18,7 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Text.RegularExpressions;
|
||||
|
||||
using SparkleLib;
|
||||
|
||||
|
@ -165,7 +166,7 @@ namespace SparkleShare {
|
|||
email = email.Trim ();
|
||||
|
||||
bool fields_valid = (!string.IsNullOrWhiteSpace (full_name) &&
|
||||
Program.Controller.IsValidEmail (email));
|
||||
IsValidEmail (email));
|
||||
|
||||
if (UpdateSetupContinueButtonEvent != null)
|
||||
UpdateSetupContinueButtonEvent (fields_valid);
|
||||
|
@ -318,6 +319,15 @@ namespace SparkleShare {
|
|||
ChangePathFieldEvent ("", "", FieldState.Enabled);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private bool IsValidEmail (string email)
|
||||
{
|
||||
Regex regex = new Regex (@"^[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,4}$",
|
||||
RegexOptions.IgnoreCase);
|
||||
|
||||
return regex.IsMatch (email);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Reference in a new issue