Esempio n. 1
0
        public static void IncludeAttribLinks(XmlNodeList nodeList, string attrname, string filename)
        {
            foreach (XmlNode node in nodeList)
            {
                XmlAttribute attr = node.Attributes [attrname];
                if (attr == null)
                {
                    continue;
                }

                Console.WriteLine(spaces + "   " + attr.Value);
                string linkfilename = attr.Value;
                linkfilename = XhtmlHelpSource.GetAbsoluteLink(linkfilename, filename);
                if (linkfilename != null)
                {
                    if (File.Exists(linkfilename) && packed_files [linkfilename] == null)
                    {
                        packed_files [linkfilename] = linkfilename;
                        nodeToAddChildrenTo.tree.HelpSource.PackFile(linkfilename, linkfilename);
                    }
                    else
                    {
                        Console.WriteLine(spaces + "Warning: file {0} not found", linkfilename);
                    }
                }
            }
        }
Esempio n. 2
0
        public static HelpSource GetHelpSource(string provider, string basefilepath)
        {
            HelpSource result;

            try {
                switch (provider)
                {
                case "xhtml":
                case "hb":
                    result = new XhtmlHelpSource(basefilepath, false);
                    break;

                case "man":
                    result = new ManHelpSource(basefilepath, false);
                    break;

                case "error":
                    result = new ErrorHelpSource(basefilepath, false);
                    break;

                case "ecmaspec":
                    result = new EcmaSpecHelpSource(basefilepath, false);
                    break;

                case "ecma":
                    result = new EcmaHelpSource(basefilepath, false);
                    break;

                default:
                    Console.Error.WriteLine("Error: Unknown provider specified: {0}", provider);
                    result = null;
                    break;
                }
            } catch (FileNotFoundException) {
                Console.Error.WriteLine("Error: did not find one of the files in sources/" + basefilepath);
                result = null;
            }
            return(result);
        }