Esempio n. 1
0
        unsafe static public object get_typ(IntPtr obj, bool istype, bool ucase)
        {
            object tobj;
            RT_STR rd = new RT_STR();

            using (Mart _obj = new Mart(obj, false))
            {
                Int32 i32 = obj.ToInt32();
                if (_obj.IsIntResource)
                {
                    if (!istype)
                    {
                        tobj = i32;
                    }
                    else if (rd.ContainsKey(i32))
                    {
                        tobj = tutil._u(rd[i32], ucase);
                    }
                    else
                    {
                        tobj = obj.ToInt32();
                    }
                }
                else
                {
                    tobj = (string)_obj.GetStringAnsi().Clone();
                }
                _obj.data = null;
            }
            rd.Clear();
            rd = null;
            return(tobj);
        }
Esempio n. 2
0
        static public int get_int(string v)
        {
            int    rv  = -1;
            RT_STR dic = new RT_STR();

            if (!has_value(v))
            {
                return(rv);
            }
            foreach (RT_STR.DictNode dn in dic.ToDictNodeArray())
            {
                if (tutil._l(dn.Value).Equals(tutil._l(v)))
                {
                    rv = dn.Key; break;
                }
            }
            return(rv);
        }
Esempio n. 3
0
 /// assumes you allready checked if this is a resource id
 static public IntPtr _i(object o)
 {
     Global.cstat(ConsoleColor.Yellow, (RC_ENUM)RT_STR.get_int(o.ToString()));
     return(new IntPtr(RT_STR.get_int(o.ToString())));
 }
Esempio n. 4
0
 static public bool _isres(object o)
 {
     return(RT_STR.has_value(o.ToString()));
 }