예제 #1
0
        public void InstallModule(Module module)
        {
            Console.WriteLine("Adding to Module List");
            XmlDocument ModuleXml  = ShellCore.XmlOpenFile("Modules.xml");
            XmlNode     moduleRoot = ShellCore.XmlGetRootNode(ModuleXml, true, "Modules", 58);

            ModuleXml = ShellCore.XmlAddNode(ModuleXml, moduleRoot, "Module");
            XmlNode moduleModule = ShellCore.XmlGetNode(moduleRoot, "Module");

            ModuleXml = ShellCore.XmlAddAttribute(ModuleXml, moduleModule, "Name", module.Name.Trim());
            ModuleXml = ShellCore.XmlAddAttribute(ModuleXml, moduleModule, "Author", module.Author.Trim());
            ModuleXml = ShellCore.XmlAddAttribute(ModuleXml, moduleModule, "Version", module.Version.Trim());
            ModuleXml = ShellCore.XmlAddAttribute(ModuleXml, moduleModule, "Copyright", module.Copyright.Trim());
            ModuleXml = ShellCore.XmlAddAttribute(ModuleXml, moduleModule, "Website", module.Website.Trim());
            ModuleXml = ShellCore.XmlAddAttribute(ModuleXml, moduleModule, "Dll", module.Dll.Trim());
            ModuleXml = ShellCore.XmlAddAttribute(ModuleXml, moduleModule, "Extends", module.Extends.ToString());
            ModuleXml = ShellCore.XmlSaveFile(ModuleXml, "Modules.xml");
            ShellCore.DeleteFileEx("Modules/Module.xml");
            ShellCore.DeleteFileEx("Module.zip");
        }