コード例 #1
0
 internal SpecializerHandle(TypeNode.NestedTypeProvider/*!*/ nestedTypeProvider, TypeNode.TypeMemberProvider/*!*/ typeMemberProvider, TypeNode.TypeSignatureProvider typeSignatureProvider, TypeNode.TypeAttributeProvider typeAttributeProvider, object/*!*/ handle) {
   this.NestedTypeProvider = nestedTypeProvider;
   this.TypeMemberProvider = typeMemberProvider;
   this.TypeSignatureProvider = typeSignatureProvider;
   this.TypeAttributeProvider = typeAttributeProvider;
   this.Handle = handle;
   //^ base();
 }
コード例 #2
0
ファイル: Reader.cs プロジェクト: julianhaslinger/SHFB
        private TypeNode/*!*/ ConstructCorrectTypeNodeSubclass(int i, Identifier/*!*/ namesp, int firstInterfaceIndex, int lastInterfaceIndex,
          TypeFlags flags, InterfaceList interfaces, int baseTypeCodedIndex, bool isSystemEnum)
        {
            TypeNode result;
            TypeNode.TypeAttributeProvider attributeProvider = new TypeNode.TypeAttributeProvider(this.GetTypeAttributes);
            TypeNode.NestedTypeProvider nestedTypeProvider = new TypeNode.NestedTypeProvider(this.GetNestedTypes);
            TypeNode.TypeMemberProvider memberProvider = new TypeNode.TypeMemberProvider(this.GetTypeMembers);
            bool isTemplateParameter = false;

            if ((flags & TypeFlags.Interface) != 0)
            {
                if (isTemplateParameter)
                    result = new TypeParameter(interfaces, nestedTypeProvider, attributeProvider, memberProvider, i);
                else
                    result = new Interface(interfaces, nestedTypeProvider, attributeProvider, memberProvider, i);
            }
            else if (isTemplateParameter)
            {
                result = new ClassParameter(nestedTypeProvider, attributeProvider, memberProvider, i);
            }
            else
            {
                result = null;
                TypeNode baseClass = this.GetTypeIfNotGenericInstance(baseTypeCodedIndex);
                if (baseClass != null)
                {
                    if (baseClass == CoreSystemTypes.MulticastDelegate) //TODO: handle single cast delegates
                        result = new DelegateNode(nestedTypeProvider, attributeProvider, memberProvider, i);
                    else if (baseClass == CoreSystemTypes.Enum)
                        result = new EnumNode(nestedTypeProvider, attributeProvider, memberProvider, i);
                    else if (baseClass == CoreSystemTypes.ValueType &&
                      !(isSystemEnum && (flags & TypeFlags.Sealed) == 0))
                    {
                        result = new Struct(nestedTypeProvider, attributeProvider, memberProvider, i);
                    }
                }

                if(result == null)
                    result = new Class(nestedTypeProvider, attributeProvider, memberProvider, i);
            }

            result.Flags = flags;
            result.Interfaces = interfaces;
            return result;
        }