コード例 #1
0
        string GenerateUniqueIdByAppendingNumberToEnd(string id)
        {
            int    count  = 0;
            string baseId = id;

            do
            {
                ++count;
                id = String.Concat(baseId, count);
            } while (OwnerWixDocument.ComponentIdExists(id));

            return(id);
        }
コード例 #2
0
        /// <remarks>
        /// Takes the filename, removes all periods, and
        /// capitalises the first character and first extension character.
        /// </remarks>
        public void GenerateUniqueIdFromFileName(string fileName)
        {
            Id = GenerateIdFromFileName(fileName);
            if (!OwnerWixDocument.ComponentIdExists(Id))
            {
                return;
            }

            Id = GenerateIdFromParentDirectoryAndFileName(fileName, Id);
            if (!OwnerWixDocument.ComponentIdExists(Id))
            {
                return;
            }

            Id = GenerateUniqueIdByAppendingNumberToEnd(Id);
        }