Пример #1
0
        // creates the lowercase method for this string property.
        // if this property is not a string, then returns null.
        public XMethod ToLowerCaseStringMethod()
        {
            if (m_gt != ChilkatTypes.GT_STRING)
            {
                return(null);
            }

            // If this is a string property, then create an XMethod object
            // from the xProp that is the lowercase name returning a string with no args.
            XMethod xLowerCaseProp = new XMethod();

            Chilkat.Xml x = cloneEntryXml();
            if (x == null)
            {
                return(null);
            }

            x.Tag = "method";
            string strName = StringUtil.ToLowerFirstChar(x.GetAttrValue("name"));

            x.UpdateAttribute("name", strName);
            // The "cppType" child (return type for the method) must change from "CkString &" to "const char *"
            //x.UpdateChildContent("cppType", "const char *");

            x.NewChild2("args2", "");

            xLowerCaseProp.IsLowercaseAlt = true;       // Set IsLowercaseAlt before loading the XML...
            xLowerCaseProp.LoadMethodXml(x);

            return(xLowerCaseProp);
        }
Пример #2
0
        private bool loadStandardEvents(Chilkat.Log log)
        {
            string standardEventsXmlPath = AppDataDir.BaseDir + "/appData/apiManager/standardEvents.xml";

            Chilkat.Xml xml = new Chilkat.Xml();
            if (!xml.LoadXmlFile(standardEventsXmlPath))
            {
                log.LogError("Failed to load standard events XML");
                return(false);
            }
            xml.AddOrUpdateAttribute("sourceXmlPath", standardEventsXmlPath);

            // The root of this XML document is an "events" node..
            int n = xml.NumChildren;

            for (int i = 0; i < n; i++)
            {
                Chilkat.Xml xEntry = xml.GetChild(i);
                XMethod     xEvent = new XMethod();
                xEvent.LoadMethodXml(xEntry);
                m_events.Add(xEvent.EntryName, xEvent);
                m_eventList.Add(xEvent);
            }

            return(true);
        }
Пример #3
0
        // creates the lowercase method for this string method.
        public XMethod ToLowerCaseStringMethod()
        {
            if (m_gt != ChilkatTypes.GT_STRING)
            {
                return(null);
            }

            // If this is a string method, then create an XMethod object
            // from the xProp that is the lowercase name returning a string with no args.
            XMethod xLowerCaseMeth = new XMethod();

            Chilkat.Xml x = cloneEntryXml();
            if (x == null)
            {
                throw new Exception();
            }

            string strName = StringUtil.ToLowerFirstChar(x.GetAttrValue("name"));

            x.UpdateAttribute("name", strName);

            xLowerCaseMeth.m_isLowerCaseAlt = true;

            xLowerCaseMeth.LoadMethodXml(x);

            return(xLowerCaseMeth);
        }
Пример #4
0
        public XMethod CreateAsyncMethod()
        {
            Chilkat.Xml xml = cloneEntryXml();
            convertMethodToAsync(xml);
            XMethod asyncMethod = new XMethod();

            asyncMethod.LoadMethodXml(xml);
            return(asyncMethod);
        }
Пример #5
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);
                }
            }
        }