コード例 #1
0
        // Load common links, such as those for UnlockComponent, from appData\apiManager\commonLinks.xml
        private bool integrateCommonLinks(Chilkat.Log log)
        {
            // No need for refdoc links if we're not using this code for refdoc generation.
            if (AppData.GitHubCodeBase)
            {
                return(true);
            }

            Chilkat.Xml xmlCommon = new Chilkat.Xml();
            if (!xmlCommon.LoadXmlFile(AppData.BaseDir + "/appData/apiManager/commonLinks.xml"))
            {
                log.LogError("Failed to load commonLinks.xml");
                return(false);
            }

            int    i;
            int    n       = xmlCommon.NumChildren;
            string strName = null;

            for (i = 0; i < n; i++)
            {
                xmlCommon.GetChild2(i);

                strName = xmlCommon.GetAttrValue("name");
                if ((strName != null) && xmlCommon.HasChildWithTag("links2"))
                {
                    if (xmlCommon.TagEquals("method"))
                    {
                        XMethod method = GetMethodByName(strName);
                        if (method != null)
                        {
                            xmlCommon.FindChild2("links2");
                            method.CopyLinks(xmlCommon);
                            xmlCommon.GetParent2();
                        }
                    }
                    else if (xmlCommon.TagEquals("property"))
                    {
                        XProperty prop = GetPropertyByName(strName);
                        if (prop != null)
                        {
                            xmlCommon.FindChild2("links2");
                            prop.CopyLinks(xmlCommon);
                            xmlCommon.GetParent2();
                        }
                    }
                }
                xmlCommon.GetParent2();
            }

            return(true);
        }
コード例 #2
0
        // Load common links, such as those for UnlockComponent, from C:\ck2000\appData\apiManager\commonLinks.xml
        private bool integrateCommonLinks(Chilkat.Log log)
        {
            Chilkat.Xml xmlCommon = new Chilkat.Xml();
            if (!xmlCommon.LoadXmlFile(PATH_COMMON_LINKS_XML))
            {
                log.LogError("Failed to load commonLinks.xml");
                return(false);
            }

            int    i;
            int    n       = xmlCommon.NumChildren;
            string strName = null;

            for (i = 0; i < n; i++)
            {
                xmlCommon.GetChild2(i);

                strName = xmlCommon.GetAttrValue("name");
                if ((strName != null) && xmlCommon.HasChildWithTag("links2"))
                {
                    if (xmlCommon.TagEquals("method"))
                    {
                        XMethod method = GetMethodByName(strName);
                        if (method != null)
                        {
                            xmlCommon.FindChild2("links2");
                            method.CopyLinks(xmlCommon);
                            xmlCommon.GetParent2();
                        }
                    }
                    else if (xmlCommon.TagEquals("property"))
                    {
                        XProperty prop = GetPropertyByName(strName);
                        if (prop != null)
                        {
                            xmlCommon.FindChild2("links2");
                            prop.CopyLinks(xmlCommon);
                            xmlCommon.GetParent2();
                        }
                    }
                }
                xmlCommon.GetParent2();
            }

            return(true);
        }