Exemplo n.º 1
0
        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);
        }
Exemplo n.º 2
0
        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));
                    }
                }
            }
        }