bool CheckEntryName(string name, int limit) { limit--; if (name == string.Empty) { MessageBox.Show(this, DevStringTable.Instance["Error:CSFEmptyName"], DevStringTable.Instance["GUI:Error"], MessageBoxButtons.OK, MessageBoxIcon.Error); return(false); } int times = 0; for (int i = 0; i < fileData.Count; i++) { for (int j = 0; j < fileData[i].data.Count; j++) { if (CaseInsensitiveStringComparer.Compare(fileData[i].data[j].name, name)) { times++; if (times > limit) { MessageBox.Show(this, DevStringTable.Instance["Error:CSFDupName"].Replace("{0}", name), DevStringTable.Instance["GUI:Error"], MessageBoxButtons.OK, MessageBoxIcon.Error); return(false); } } } } return(true); }
public static string[] CheckNone(string[] arr) { if (arr.Length == 1) { if (CaseInsensitiveStringComparer.Compare(arr[0], none)) { return(Utils.EmptyStringArray); } return(arr); } return(arr); }
public static string CheckNoneNull(string str) { if (str == null) { return(null); } if (CaseInsensitiveStringComparer.Compare(str, none)) { return(null); } return(str); }
public static bool IsNone(string str) { return(CaseInsensitiveStringComparer.Compare(str, none)); }