public static string GetSafeName(string name, IMSBuildProject msBuildProject, bool fileSystemFriendly)
        {
            string identifier = SampleDataNameHelper.NormalizeName(name, fileSystemFriendly);

            if (string.IsNullOrEmpty(identifier) || !msBuildProject.IsSafeIdentifier(identifier))
            {
                return((string)null);
            }
            return(identifier);
        }
        public static string GetUniqueName(string name, IMSBuildProject msBuildProject, IEnumerable <string> existingNames, string nameToIgnore, bool fileSystemFriendly)
        {
            string str = SampleDataNameHelper.NormalizeName(name, fileSystemFriendly);

            if (string.IsNullOrEmpty(str) || !msBuildProject.IsSafeIdentifier(str))
            {
                return((string)null);
            }
            if (SampleDataNameHelper.IsUniqueAndSafeName(str, msBuildProject, existingNames, nameToIgnore, fileSystemFriendly))
            {
                return(str);
            }
            NumberedName numberedName = new NumberedName(str);

            while (numberedName.Increment())
            {
                string currentName = numberedName.CurrentName;
                if (SampleDataNameHelper.IsUniqueAndSafeName(currentName, msBuildProject, existingNames, nameToIgnore, fileSystemFriendly))
                {
                    return(currentName);
                }
            }
            return((string)null);
        }