Example #1
0
        public void SaveResource(PhactoryHost.Database.Resource resource)
        {
            bool writeOK = Host.XMLWrite(Host.GetFileInfo(resource).FullName, viewBinding[resource].View.Document);

            if (writeOK)
            {
                if (Host.IsVerboseOutput())
                {
                    Host.Log(resource.DisplayName + " written");
                }

                Host.RefreshOutput(resource);
                List <PhactoryHost.Database.Resource> dependentResources = new List <PhactoryHost.Database.Resource>();
                foreach (Document.Item item in viewBinding[resource].View.Document.Items)
                {
                    dependentResources.Add(Plugin.ControllerEditor.Host.GetResource(item.ResourceID));
                }
                Host.RefreshDependencies(resource, dependentResources);

                viewBinding[resource].View.SetModified(false);
            }
            else
            {
                Host.Log("Problem while writing " + resource.DisplayName);
            }
        }