Beispiel #1
0
        void ConvertHelpfile()
        {
#if NotModifiedForAltaxo
            string basePath = Application.StartupPath + Path.DirectorySeparatorChar +
                              ".." + Path.DirectorySeparatorChar +
                              ".." + Path.DirectorySeparatorChar +
                              "doc" + Path.DirectorySeparatorChar +
                              "help";
#else
            string basePath = Path.GetDirectoryName(
                System.Reflection.Assembly.GetExecutingAssembly().Location)
                              + Path.DirectorySeparatorChar +
                              ".." + Path.DirectorySeparatorChar +
                              "doc" + Path.DirectorySeparatorChar +
                              "help";
#endif

            if (!File.Exists(basePath + Path.DirectorySeparatorChar + @"HelpDescription.xml"))
            {
                Console.WriteLine("HelpDescription.xml not found!");
                return;
            }

            XmlDocument doc = new XmlDocument();
            doc.Load(basePath + Path.DirectorySeparatorChar + @"HelpDescription.xml");

            XmlDocument newDoc = new XmlDocument();
            newDoc.LoadXml("<HelpCollection/>");
            hhcFileParser = new HhcFileParser(basePath);
            ParseTree(newDoc, newDoc.DocumentElement, doc.DocumentElement);

            try {
                newDoc.Save(basePath + Path.DirectorySeparatorChar + "HelpConv.xml");
            } catch (Exception e) {
                Console.Error.WriteLine("Can't save HelpConv.xml (No write permission?) : " + e.ToString());
            }

            try {
                ZipHelpFile(basePath);
            } catch (Exception e) {
                Console.Error.WriteLine("Error while zipping helpfile : " + e.ToString());
            }
        }
Beispiel #2
0
		void ConvertHelpfile()
		{
#if ModifiedForAltaxo
			string basePath = Path.GetDirectoryName(
				System.Reflection.Assembly.GetExecutingAssembly().Location)
				+ Path.DirectorySeparatorChar +
				".." + Path.DirectorySeparatorChar +
				"doc" + Path.DirectorySeparatorChar +
				"help";
#else
			string basePath = Application.StartupPath + Path.DirectorySeparatorChar +
			                  ".." + Path.DirectorySeparatorChar +
			                  ".." + Path.DirectorySeparatorChar +
			                  "doc" + Path.DirectorySeparatorChar +
							  "help";
#endif

			if (!File.Exists(basePath + Path.DirectorySeparatorChar + @"HelpDescription.xml")) 
			{
				Console.WriteLine("HelpDescription.xml not found!");
				return;
			}
			
			XmlDocument doc = new XmlDocument();
			doc.Load(basePath + Path.DirectorySeparatorChar + @"HelpDescription.xml");
			
			XmlDocument newDoc = new XmlDocument();
			newDoc.LoadXml("<HelpCollection/>");
			hhcFileParser = new HhcFileParser(basePath);
			ParseTree(newDoc, newDoc.DocumentElement, doc.DocumentElement);
			
			try {
				newDoc.Save(basePath + Path.DirectorySeparatorChar + "HelpConv.xml");
			} catch (Exception e) {
				Console.Error.WriteLine("Can't save HelpConv.xml (No write permission?) : " + e.ToString());
			}
			
			try {
				ZipHelpFile(basePath);
			} catch (Exception e) {
				Console.Error.WriteLine("Error while zipping helpfile : " + e.ToString());
			}
		}