Beispiel #1
0
        public bool getBoolMember(int i, bool defValue)
        {
            if (!hasMember(i))
            {
                return(defValue);
            }
            CObject member = getMember(i);
            object  o      = member.convert();

            if (o is bool)
            {
                return((bool)o);
            }

            return((bool)CBooleanConvertor.inst.convert(getMember(i)));
        }
Beispiel #2
0
        internal string getStringMember(int i)
        {
            CObject member = getMember(i);

            if (member == null)
            {
                return("");
            }
            object o = member.convert();

            if (o is string)
            {
                return((string)o);
            }
            return((string)CStringConvertor.inst.convert(getMember(i)));
        }
Beispiel #3
0
        internal float getFloatMember(int i, float defaultVal)
        {
            CObject member = getMember(i);

            if (member == null)
            {
                return(defaultVal);
            }
            object o = member.convert();

            if (o is float)
            {
                return((float)o);
            }

            return((float)CFloatConvertor.inst.convert(getMember(i)));
        }
Beispiel #4
0
        public int getIntMember(int i)
        {
            CObject member = getMember(i);
            object  o      = member.convert();

            if (o is int)
            {
                return((int)o);
            }
            if (o is long)
            {
                return((int)((long)o));
            }


            return((int)CIntConvertor.inst.convert(getMember(i)));
        }