Exemplo n.º 1
0
        static AltType GetAltType(AltTypes altTypes, Type type, IntPtr declaration)
        {
            if (altTypes.ContainsKey(type))
            {
                return(altTypes[type]);
            }

            var altType = new AltType(altTypes, type, declaration);

            //altTypes[type] = altType;
            return(altType);
        }
Exemplo n.º 2
0
        public static AltType GetAltType(AltTypes altTypes, Type type, object value)
        {
            if (altTypes.ContainsKey(type))
            {
                return(altTypes[type]);
            }

            var    ptr         = GetPtr(value);
            IntPtr declaration = IntPtr.Zero;

#if !SAFE_COPY
            //lock (locker)
            declaration = Marshal.ReadIntPtr(ptr);
#endif
            AltType altType = new AltType(altTypes, type, declaration);
            return(altType);
        }