コード例 #1
0
        /// <summary>
        /// Append the xmlData node to the web.config file
        /// </summary>
        /// <param name="packageName">Name of the package that we install</param>
        /// <param name="xmlData">The data that must be appended to the web.config file</param>
        /// <returns>True when succeeded</returns>
        public bool Execute(string packageName, XmlNode xmlData)
        {
            var    addSectionAction = new AddConfigSection();
            var    removeSection    = addSectionAction.Undo(packageName, xmlData);
            string folderPath       = HttpContext.Current.Server.MapPath("/Noesis.Javascript");

            foreach (var subDir in new DirectoryInfo(folderPath).GetDirectories())
            {
                subDir.Delete(true);
            }
            return(removeSection);
        }
コード例 #2
0
        /// <summary>
        /// Append the xmlData node to the web.config file
        /// </summary>
        /// <param name="packageName">Name of the package that we install</param>
        /// <param name="xmlData">The data that must be appended to the web.config file</param>
        /// <returns>True when succeeded</returns>
        public bool Execute(string packageName, XmlNode xmlData)
        {
            var    addSectionAction = new AddConfigSection();
            var    removeSection    = addSectionAction.Undo(packageName, xmlData);
            string folderPath       = HttpContext.Current.Server.MapPath("/Noesis.Javascript");

            if (Directory.Exists(folderPath))
            {
                Directory.Delete(folderPath);
            }

            string newPath = HttpContext.Current.Server.MapPath("/ClearScript.V8");

            foreach (var file in new DirectoryInfo(newPath).GetFiles())
            {
                if (file.Extension != ".dat")
                {
                    File.Delete(file.FullName);
                }
            }

            foreach (var file in new DirectoryInfo(newPath).GetFiles())
            {
                if (file.Extension == ".dat")
                {
                    File.Move(file.FullName, Path.ChangeExtension(file.FullName, ".dll"));
                }
            }

            //Remove Noesis.Javascript hidden segment

            var hiddenSegement = new AddHiddenSegment();
            var str            = "<Action runat=\"install\" undo=\"true\" alias=\"Umbundle.V8.AddHiddenSegment\" position=\"beginning\" segment=\"Noesis.Javascript\" />";

            var doc = new XmlDocument();

            doc.LoadXml(str);
            var newNode = doc.DocumentElement;

            hiddenSegement.Undo("", newNode);

            return(removeSection);
        }