/// <summary> /// Gets the regex pattern by template key. /// </summary> /// <param name="templateKey">The template key.</param> /// <returns></returns> public static String GetPattern(RegexTemplates templateKey) { String regex = String.Empty; if (ValidationTemplates.ContainsKey(templateKey)) { regex = ValidationTemplates[templateKey]; } return regex; }
/// <summary> /// Gets the regex pattern by template key. /// </summary> /// <param name="templateKey">The template key.</param> /// <returns></returns> public static String GetPattern(RegexTemplates templateKey) { String regex = String.Empty; if (ValidationTemplates.ContainsKey(templateKey)) { regex = ValidationTemplates[templateKey]; } return(regex); }
public void HandleExeption(Exception e, string source) { DateTime t = DateTime.Now; String Save = "\n\nCrash of APK Downgrader has been catched at " + t.Day.ToString("d2") + "." + t.Month.ToString("d2") + "." + t.Year.ToString("d4") + " " + t.Hour.ToString("d2") + ":" + t.Minute.ToString("d2") + ":" + t.Second.ToString("d2") + "." + t.Millisecond.ToString("d5"); Save += "\nUseful information:"; Save += "\n- Version: " + versionTag; Save += "\n- Execution directory (Usernames Removed): " + RegexTemplates.RemoveUserName(exe); Save += "\n\nException (Usernames Removed):\n " + RegexTemplates.RemoveUserName(e.ToString()); File.AppendAllText(exe + "\\Crash.log", Save); MessageBoxResult r = MessageBox.Show("Oops. Something has gone wrong as you shouldn't see that window. Please contect ComputerElite via GitHub issues or Discord and send then the file names Crash.log next to the exe. Exception:\n\n" + RegexTemplates.RemoveUserName(e.ToString()), "APK Downgrader - Exception Reporter", MessageBoxButton.OK, MessageBoxImage.Error); Process.GetCurrentProcess().Kill(); }