using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Text.RegularExpressions; using System.Threading.Tasks; using System.Windows; namespace RKISPATTERN.Helpers { public class Helper { public static void CloseWindow() { foreach (var wnd in App.Current.Windows) { if (wnd is T) ((Window)wnd).Close(); } } public static bool CheckLoginPass(string str) { if (string.IsNullOrEmpty(str)) return false; Regex regex = new Regex(@"[0-9a-zA-Z]{6,30}"); return regex.IsMatch(str); } public static bool CheckPhone(string phone) { if (string.IsNullOrEmpty(phone)) return false; Regex regex = new Regex(@"^\+[\d]{11}$"); return regex.IsMatch(phone); } public static bool CheckName(string name) { if (string.IsNullOrEmpty(name)) return false; return true; } } }