public void LoadExistingContents()

in src/FabActUtil/Generator/ManifestGenerator.cs [1389:1454]


            public void LoadExistingContents()
            {
                // Load AppManifest
                if (this.ShouldGenerateApplicationManifest())
                {
                    Utility.EnsureParentFolder(this.ApplicationManifestFilePath);
                    this.ExistingApplicationManifestContents = Utility.LoadContents(this.ApplicationManifestFilePath).Trim();

                    this.ExistingApplicationManifestType = XmlSerializationUtility
                        .Deserialize<ApplicationManifestType>(
                            this.ExistingApplicationManifestContents);

                    // If startupServicesFilesPath is provided, load content from this file
                    if (!string.IsNullOrEmpty(this.StartupServicesFilePath))
                    {
                        Utility.EnsureParentFolder(this.StartupServicesFilePath);
                        this.ExistingStartupServicesContents = Utility.LoadContents(this.StartupServicesFilePath).Trim();

                        this.ExistingStartupServicesManifestType = XmlSerializationUtility
                            .Deserialize<StartupServicesManifestType>(
                                this.ExistingStartupServicesContents);
                        this.StartupServicesFlag = true;

                        Console.WriteLine("StartupServicesFlag has been set to true");

                        // Create ActorService name and GeneratedIdRef map to be used while merging parameters later.
                        if (this.ExistingStartupServicesManifestType != null
                            && this.ExistingStartupServicesManifestType.Services != null
                            && this.ExistingStartupServicesManifestType.Services.Items != null)
                        {
                            foreach (var service in this.ExistingStartupServicesManifestType.Services.Items)
                            {
                                var castedType = service as StartupDefaultServicesTypeService;
                                this.existingActorServiceGeneratedIdRefNamesMap.Add(castedType.Name, castedType.GeneratedIdRef);
                            }
                        }
                    }
                    else
                    {
                        // Create ActorService name and GeneratedIdRef map to be used while merging parameters later.
                        if (this.ExistingApplicationManifestType != null
                        && this.ExistingApplicationManifestType.DefaultServices != null
                        && this.ExistingApplicationManifestType.DefaultServices.Items != null)
                        {
                            foreach (var defaultService in this.ExistingApplicationManifestType.DefaultServices.Items)
                            {
                                var castedType = defaultService as DefaultServicesTypeService;
                                this.existingActorServiceGeneratedIdRefNamesMap.Add(castedType.Name, castedType.GeneratedIdRef);
                            }
                        }
                    }
                }

                // Load Service Manifest
                Utility.EnsureParentFolder(this.ServiceManifestFilePath);
                this.ExistingServiceManifestContents = Utility.LoadContents(this.ServiceManifestFilePath).Trim();
                this.ExistingServiceManifestType = XmlSerializationUtility
                    .Deserialize<ServiceManifestType>(
                        this.ExistingServiceManifestContents);

                // Load Config.
                Utility.EnsureParentFolder(this.ConfigSettingsFilePath);
                this.ExistingConfigSettingsContents = Utility.LoadContents(this.ConfigSettingsFilePath).Trim();

                this.LoadExistingGeneratedNames();
            }