private static bool AlreadyExistInUniqueConstraintNameList(ImageStore imgstore, string x) { foreach (ImageItem e3pi in imgstore.items) { if (e3pi.name.Equals(x)) { return true; } } return false; }
public static string GetName(ImageStore imgstore, string p) { string x = p; while (AlreadyExistInUniqueConstraintNameList(imgstore, x)) { string sWithoutNumber = ""; int iNum = GetStringLastNumber(x, ref sWithoutNumber); iNum++; x = sWithoutNumber + iNum; } return x; }