Beispiel #1
0
        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);
        }
Beispiel #2
0
 public static string[] CheckNone(string[] arr)
 {
     if (arr.Length == 1)
     {
         if (CaseInsensitiveStringComparer.Compare(arr[0], none))
         {
             return(Utils.EmptyStringArray);
         }
         return(arr);
     }
     return(arr);
 }
Beispiel #3
0
 public static string CheckNoneNull(string str)
 {
     if (str == null)
     {
         return(null);
     }
     if (CaseInsensitiveStringComparer.Compare(str, none))
     {
         return(null);
     }
     return(str);
 }
Beispiel #4
0
 public static bool IsNone(string str)
 {
     return(CaseInsensitiveStringComparer.Compare(str, none));
 }