public bool Execute(string packageName, XmlNode xmlData) { Initialize(xmlData); if (TargetFile != null) { XElement root = TargetFile.Root; if (root == null) { root = new XElement(SourceFile.Root.Name); TargetFile.Add(root); } if (!fileMoved) { MergeElement(SourceFile.Root, root); //Save file TargetFile.Save(TargetFilePath, SaveOptions.None); if (!embeddedResource) { File.Delete(HostingEnvironment.MapPath(SourceFilePath)); } } } return(true); }
public void Install() { if (TargetFile != null) { XElement root = TargetFile.Root; if (root == null) { root = new XElement(SourceFile.Root.Name); TargetFile.Add(root); } if (!fileMoved) { MergeElement(SourceFile.Root, root); //Save file TargetFile.Save(TargetFilePath, SaveOptions.None); if (!EmbeddedResource) { File.Delete(HostingEnvironment.MapPath(SourceFilePath)); } } } }