Ejemplo n.º 1
0
        private void addClassEntries(Chilkat.Xml xml)
        {
            int i, n;

            // the methods.
            Chilkat.Xml x = xml.FindChild("methods");
            if (x != null)
            {
                n = x.NumChildren;
                for (i = 0; i < n; i++)
                {
                    Chilkat.Xml xEntry  = x.GetChild(i);
                    XMethod     xMethod = new XMethod();
                    xMethod.LoadMethodXml(xEntry);
                    m_methods.Add(xMethod.EntryName, xMethod);
                    m_methodList.Add(xMethod);
                }
            }

            // the properties.
            x = xml.FindChild("properties");
            if (x != null)
            {
                n = x.NumChildren;
                for (i = 0; i < n; i++)
                {
                    Chilkat.Xml xEntry = x.GetChild(i);
                    XProperty   xprop  = new XProperty();
                    xprop.loadPropXml(xEntry);
                    m_props.Add(xprop.EntryName, xprop);
                    m_propList.Add(xprop);
                }
            }

            // the events.
            x = xml.FindChild("events");
            if (x != null)
            {
                n = x.NumChildren;
                for (i = 0; i < n; i++)
                {
                    Chilkat.Xml xEntry = x.GetChild(i);
                    // If the tag is "standard", ignore it because we'll be loading the standard events elsewhere..
                    if (xEntry.TagEquals("standard"))
                    {
                        continue;
                    }

                    XMethod xEvent = new XMethod();
                    xEvent.LoadMethodXml(xEntry);
                    m_events.Add(xEvent.EntryName, xEvent);
                    m_eventList.Add(xEvent);
                }
            }
        }
Ejemplo n.º 2
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);
        }
Ejemplo n.º 3
0
        public void RemoveProperty(string name)
        {
            m_props.Remove(name);
            int n = m_propList.Count;

            for (int i = 0; i < n; i++)
            {
                XProperty xprop = (XProperty)m_propList[i];
                if (xprop.EntryName.Equals(name))
                {
                    m_propList.RemoveAt(i);
                    break;
                }
            }
            removeXmlEntry("properties", "property", name);
        }
Ejemplo n.º 4
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);
        }
Ejemplo n.º 5
0
        public void AddProperty(XProperty xprop)
        {
            if (xprop == null)
            {
                return;
            }
            if (ContainsProperty(xprop.EntryName))
            {
                throw new Exception();
            }
            m_propList.Add(xprop);
            m_propList.Sort();

            m_props.Add(xprop.EntryName, xprop);

            Chilkat.Xml x = m_xml.FindChild("properties");
            if (x == null)
            {
                x = m_xml.NewChild("properties", "");
            }
            Chilkat.Xml xp = xprop.GetXml_careful();
            x.AddChildTree(xp);
            return;
        }