Exemplo n.º 1
0
        /// <summary>
        ///     Replaces the placeholders in selected items.
        /// </summary>
        private void ReplacePlaceholdersInSelectedItems()
        {
            var projectItems = SolutionHelper.GetSelectedProjectItemsRecursively(Package)
                               .Distinct(new ProjecItemEqualityComparer()).ToList();

            if (projectItems.Count <= 0)
            {
                MessageBox.Show("No items were found", "GUID Placeholders");
                return;
            }

            if (MessageBox.Show($"Do you wish to search and replace GUID placeholders in {projectItems.Count} items?",
                                "GUID Placeholders", MessageBoxButtons.YesNo, MessageBoxIcon.Question) != DialogResult.Yes)
            {
                return;
            }

            foreach (var projectItem in projectItems)
            {
                ReplaceGuidPlaceholders(projectItem);
            }
        }