private static void SelectConfigurationPropertyGroups(
     VSProject project, string[] selectedConfigurations,
     out XmlPropertyGroup[] selectedGroups, out XmlPropertyGroup[] redundantGroups)
 {
     SelectConfigurationElements(
         project.ParseConditionalConfigurationPropertyGroups((Func <string, bool>)null),
         selectedConfigurations, out selectedGroups, out redundantGroups);
 }
        public static void SetupUnityPluginProject(VSProject project, UnityPluginParameter parameter)
        {
            Ensure.Argument.NotNull(project, nameof(project));
            Ensure.Argument.NotNull(parameter, nameof(parameter));

            var versions = parameter.Versions;

            if (versions == null)
            {
                return;
            }

            project.RemovePropertyGroups(project.ParseConditionalConfigurationPropertyGroups((string)null));
            project.RemoveItemGroups(project.ParseConditionalConfigurationItemGroups((string)null));

            var propertyGroupAnchor = project.DefaultPropertyGroup;
            var itemGroupAnchor     = project.DefaultReferenceGroup;

            foreach (var kvp in versions)
            {
                var ver  = kvp.Key;
                var info = kvp.Value;

                foreach (var type in EnumTraits <ProjectConfigurationType> .Values)
                {
                    SetupConfigurationGroupForUnity(
                        propertyGroupAnchor = project.CreatePropertyGroupAfter(propertyGroupAnchor),
                        type, parameter.ForEditor, ver);

                    var references = info.AssemblyReferences;
                    if (!CollectionUtil.IsNullOrEmpty(references))
                    {
                        SetupReferenceGroupForUnity(
                            itemGroupAnchor = project.CreateItemGroupAfter(itemGroupAnchor),
                            type, parameter.ForEditor, ver, references);
                    }
                }
            }
        }