private string[] GetUniqueFolderName(MailboxSession mailboxStore, StoreId folderId, string[] suggestedNames)
        {
            List <string> subFolderNames = new List <string>();

            using (Folder folder = Folder.Bind(mailboxStore, folderId))
            {
                using (QueryResult queryResult = folder.FolderQuery(FolderQueryFlags.None, null, null, new PropertyDefinition[]
                {
                    FolderSchema.DisplayName
                }))
                {
                    ElcMailboxHelper.ForeachQueryResult(queryResult, delegate(object[] rowProps, ref bool breakLoop)
                    {
                        if (SearchResultProcessor.PropertyExists(rowProps[0]))
                        {
                            subFolderNames.Add((string)rowProps[0]);
                        }
                    });
                }
            }
            string[] array = new string[suggestedNames.Length];
            for (int i = 0; i < suggestedNames.Length; i++)
            {
                string        folderName = suggestedNames[i];
                List <string> list       = (from x in subFolderNames
                                            where x.StartsWith(folderName, StringComparison.OrdinalIgnoreCase)
                                            select x).ToList <string>();
                for (int j = 0; j < list.Count + 1; j++)
                {
                    if (list.Find((string x) => x.Equals(folderName, StringComparison.OrdinalIgnoreCase)) == null)
                    {
                        break;
                    }
                    folderName = string.Format("{0}-{1}", suggestedNames[i], j + 1);
                }
                array[i] = folderName;
            }
            return(array);
        }