Update mcs/class/Commons.Xml.Relaxng/Commons.Xml.Relaxng/RelaxngPattern.cs
[mono.git] / mcs / class / IKVM.Reflection / Missing.cs
index 7fc88bf625d69600501bd51563e6fab0116bc7ee..dfc7791b1404b376beca0471f1bb3364191103d0 100644 (file)
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2011 Jeroen Frijters
+  Copyright (C) 2011-2012 Jeroen Frijters
 
   This software is provided 'as-is', without any express or implied
   warranty.  In no event will the authors be held liable for any damages
@@ -140,13 +140,12 @@ namespace IKVM.Reflection
        sealed class MissingAssembly : Assembly
        {
                private readonly MissingModule module;
-               private readonly string name;
 
                internal MissingAssembly(Universe universe, string name)
                        : base(universe)
                {
                        module = new MissingModule(this);
-                       this.name = name;
+                       this.fullName = name;
                }
 
                public override Type[] GetTypes()
@@ -154,14 +153,9 @@ namespace IKVM.Reflection
                        throw new MissingAssemblyException(this);
                }
 
-               public override string FullName
-               {
-                       get { return name; }
-               }
-
                public override AssemblyName GetName()
                {
-                       return new AssemblyName(name);
+                       return new AssemblyName(fullName);
                }
 
                public override string ImageRuntimeVersion
@@ -229,6 +223,11 @@ namespace IKVM.Reflection
                        return null;
                }
 
+               internal override Type FindTypeIgnoreCase(TypeName lowerCaseName)
+               {
+                       return null;
+               }
+
                internal override IList<CustomAttributeData> GetCustomAttributesData(Type attributeType)
                {
                        throw new MissingAssemblyException(this);
@@ -280,6 +279,11 @@ namespace IKVM.Reflection
                        return null;
                }
 
+               internal override Type FindTypeIgnoreCase(TypeName lowerCaseName)
+               {
+                       return null;
+               }
+
                internal override void GetTypesImpl(System.Collections.Generic.List<Type> list)
                {
                        throw new MissingModuleException(this);
@@ -384,6 +388,11 @@ namespace IKVM.Reflection
                        return null;
                }
 
+               internal override Type FindNestedTypeIgnoreCase(TypeName lowerCaseName)
+               {
+                       return null;
+               }
+
                public override bool __IsMissing
                {
                        get { return true; }
@@ -419,6 +428,11 @@ namespace IKVM.Reflection
                        get { return module; }
                }
 
+               public override int MetadataToken
+               {
+                       get { return token; }
+               }
+
                public override bool IsValueType
                {
                        get
@@ -430,7 +444,15 @@ namespace IKVM.Reflection
                                        case TypeFlags.NotValueType:
                                                return false;
                                        default:
-                                               throw new MissingMemberException(this);
+                                               if (module.universe.ResolveMissingTypeIsValueType(this))
+                                               {
+                                                       typeFlags |= TypeFlags.ValueType;
+                                               }
+                                               else
+                                               {
+                                                       typeFlags |= TypeFlags.NotValueType;
+                                               }
+                                               return (typeFlags & TypeFlags.ValueType) != 0;
                                }
                        }
                }
@@ -533,11 +555,6 @@ namespace IKVM.Reflection
                        return this;
                }
 
-               internal int GetMetadataTokenForMissing()
-               {
-                       return token;
-               }
-
                internal override Type SetMetadataTokenForMissing(int token)
                {
                        this.token = token;
@@ -580,6 +597,18 @@ namespace IKVM.Reflection
                {
                        get { return owner as Type; }
                }
+
+               internal override Type BindTypeParameters(IGenericBinder binder)
+               {
+                       if (owner is MethodBase)
+                       {
+                               return binder.BindMethodParameter(this);
+                       }
+                       else
+                       {
+                               return binder.BindTypeParameter(this);
+                       }
+               }
        }
 
        sealed class MissingMethod : MethodInfo
@@ -752,6 +781,11 @@ namespace IKVM.Reflection
                        return Forwarder.GetMethodBody();
                }
 
+               public override int __MethodRVA
+               {
+                       get { return Forwarder.__MethodRVA; }
+               }
+
                public override CallingConventions CallingConvention
                {
                        get { return signature.CallingConvention; }
@@ -1070,6 +1104,11 @@ namespace IKVM.Reflection
                        get { throw new MissingMemberException(this); }
                }
 
+               internal override bool IsNonPrivate
+               {
+                       get { throw new MissingMemberException(this); }
+               }
+
                internal override bool IsStatic
                {
                        get { throw new MissingMemberException(this); }