示例#1
0
        public NativeTypeRef(IDeclarationContext parent, Type type, bool external = false, Type redirectbase = null)
            : base(parent, type)
        {
            if(null == type)
            {
                throw new ArgumentNullException("type");
            }

            if(external)
            {
                SetExternal();
            }

            if(type.IsSubclassOf(typeof(Delegate)))
            {
                _isdelegate = true;
            }
            else if (!type.IsValueType)
            {
                var rbase = redirectbase ?? type.BaseType;
                if (null != rbase)
                {
                    _lbase = parent.TranslateRType(rbase, TranslateOptions.Add);
                    //_typedependencies.Add(lbase);
                    AddDepdendency(_lbase, DependencyLevel.Constructor);

                    _isdelegate = _lbase.IsDelegate;
                }
            }

            parent.RegisterType(this);
        }
示例#2
0
 public Enumeration(IDeclarationContext parent, Type enumtype)
     : base(parent, enumtype)
 {
     parent.RegisterType(this);
 }
示例#3
0
 public NativeTypeRef(IDeclarationContext parent, string typename)
     : base(parent, typename)
 {
     SetExternal();
     parent.RegisterType(this);
 }