예제 #1
0
        public bool HasArgWithGt(int gt)
        {
            int i;
            int n = NumArgs;

            for (i = 0; i < n; i++)
            {
                MethodArg arg = GetArg(i);
                if (arg.Gt == gt)
                {
                    return(true);
                }
            }
            return(false);
        }
예제 #2
0
        // return true if this method has an arg that is a GT_OBJECT with the given class name.
        public bool HasArgWithClass(string genericClassName)
        {
            int i;
            int n = NumArgs;

            for (i = 0; i < n; i++)
            {
                MethodArg arg = GetArg(i);
                if (arg.IsObject)
                {
                    if (arg.DataType.Equals(genericClassName))
                    {
                        return(true);
                    }
                }
            }
            return(false);
        }
예제 #3
0
        // xml contains <args2> ... </args2>
        public MethodArgs(Chilkat.Xml xml)
        {
            m_xml = xml;
            if (xml == null)
            {
                return;
            }

            m_args = new ArrayList();

            int numArgs = xml.NumChildren;

            for (int i = 0; i < numArgs; i++)
            {
                xml.GetChild2(i);
                MethodArg arg = new MethodArg();
                arg.LoadArgXml(xml);
                m_args.Add(arg);
                xml.GetParent2();
            }
        }
예제 #4
0
        public void UpdateArg(int index, string argName, string objcName, string genericType)
        {
            //<args2>
            //    <arg name="encodedBytes" type="string" objcName="encodedBytes" />
            //    <arg name="encoding" type="string" objcName="encoding" />
            //</args2>

            Chilkat.Xml xArg = m_xml.GetChild(index);
            if (xArg == null)
            {
                throw new Exception();
            }

            xArg.UpdateAttribute("name", argName);
            xArg.UpdateAttribute("type", genericType);
            xArg.UpdateAttribute("objcName", objcName);

            MethodArg arg = (MethodArg)m_args[index];

            arg.UpdateArg(argName, objcName, genericType);

            return;
        }
예제 #5
0
        public void InsertArg(int insertIndex, string argName, string objcName, string genericType)
        {
            //<args2>
            //    <arg name="encodedBytes" type="string" objcName="encodedBytes" />
            //    <arg name="encoding" type="string" objcName="encoding" />
            //</args2>

            // Build the XML <arg> and insert it.
            Chilkat.Xml xArg = new Chilkat.Xml();
            xArg.Tag = "arg";

            xArg.AddAttribute("name", argName);
            xArg.AddAttribute("type", genericType);
            xArg.AddAttribute("objcName", objcName);

            m_xml.InsertChildTreeBefore(insertIndex, xArg);

            MethodArg arg = new MethodArg();

            arg.LoadArgXml(xArg);
            m_args.Insert(insertIndex, arg);

            return;
        }