Пример #1
0
        private void BuildProperties()
        {
            if (m_properties != null)
            {
                return;
            }

            int count = InterfaceTypeNative.GetPropertyCount(m_nativeInstance);

            m_properties = new InterfaceProperty[count];
            for (int i = 0; i < count; i++)
            {
                InterfaceProperty prop;
                prop.Name      = Marshal.PtrToStringAnsi(InterfaceTypeNative.GetPropertyName(m_nativeInstance, i));
                prop.Type      = m_collection.GetTypeFromHandle(InterfaceTypeNative.GetPropertyType(m_nativeInstance, i));
                prop.HasGetter = InterfaceTypeNative.GetPropertyHasGetter(m_nativeInstance, i);
                prop.HasSetter = InterfaceTypeNative.GetPropertyHasSetter(m_nativeInstance, i);

                m_properties[i] = prop;
            }
        }
Пример #2
0
        private void BuildFields()
        {
            if (m_fields != null)
            {
                return;
            }

            int count = StructTypeNative.GetFieldCount(m_nativeInstance);

            m_fields = new StructField[count];
            for (int i = 0; i < count; i++)
            {
                StructField field;
                field.Name = Marshal.PtrToStringAnsi(StructTypeNative.GetFieldName(m_nativeInstance, i));
                field.Type = m_collection.GetTypeFromHandle(StructTypeNative.GetFieldType(m_nativeInstance, i));

                m_fields[i] = field;
            }
        }