public void LoadExistingGeneratedNames()

in src/FabActUtil/Generator/ManifestGenerator.cs [1456:1515]


            public void LoadExistingGeneratedNames()
            {
                if (this.ExistingServiceManifestType == null || this.ExistingServiceManifestType.ServiceTypes == null)
                {
                    return;
                }

                foreach (var serviceType in this.ExistingServiceManifestType.ServiceTypes)
                {
                    if (serviceType is ServiceTypeType castedServiceType)
                    {
                        if (castedServiceType.Extensions == null)
                        {
                            // Not a FabAct generated type
                            continue;
                        }

                        foreach (var extension in castedServiceType.Extensions)
                        {
                            if (extension.Name == GeneratedServiceTypeExtensionName)
                            {
                                if (!this.existingGeneratedNames.TryGetValue(extension.Name, out var existingTypes))
                                {
                                    existingTypes = new HashSet<string>();

                                    this.existingGeneratedNames.Add(
                                        extension.Name,
                                        existingTypes);
                                }

                                existingTypes.Add(castedServiceType.ServiceTypeName);

                                var xmlEnumerator = extension.Any.ChildNodes.GetEnumerator();
                                while (xmlEnumerator.MoveNext())
                                {
                                    var xml = xmlEnumerator.Current as XmlElement;

                                    if (xml == null)
                                    {
                                        continue;
                                    }

                                    if (!this.existingGeneratedNames.TryGetValue(xml.Name, out var existingNames))
                                    {
                                        existingNames = new HashSet<string>();

                                        this.existingGeneratedNames.Add(
                                            xml.Name,
                                            existingNames);
                                    }

                                    existingNames.Add(xml.GetAttribute(GeneratedNamesAttributeName));
                                }

                                break;
                            }
                        }
                    }
                }
            }