using System.Globalization;
using System.Runtime.CompilerServices;
using System.Collections;
+using System.Collections.Generic;
using System.Runtime.InteropServices;
using System.Security;
using System.Security.Cryptography;
internal class GenericInstanceKey {
Type gtd;
internal Type[] args;
+ int hash_code;
internal GenericInstanceKey (Type gtd, Type[] args)
{
this.gtd = gtd;
this.args = args;
+
+ hash_code = gtd.GetHashCode ();
+ for (int i = 0; i < args.Length; ++i)
+ hash_code ^= args [i].GetHashCode ();
}
static bool IsBoundedVector (Type type) {
public override int GetHashCode ()
{
- int hash = gtd.GetHashCode ();
- for (int i = 0; i < args.Length; ++i)
- hash ^= args [i].GetHashCode ();
- return hash;
+ return hash_code;
}
}
#endif
}
+ // Still in use by al.exe
internal void EmbedResourceFile (string name, string fileName)
{
EmbedResourceFile (name, fileName, ResourceAttributes.Public);
}
- internal void EmbedResourceFile (string name, string fileName, ResourceAttributes attribute)
+ void EmbedResourceFile (string name, string fileName, ResourceAttributes attribute)
{
if (resources != null) {
MonoResource[] new_r = new MonoResource [resources.Length + 1];
s.Read (resources [p].data, 0, (int)len);
s.Close ();
} catch {
- /* do something */
}
}
-
+/*
internal void EmbedResource (string name, byte[] blob, ResourceAttributes attribute)
{
if (resources != null) {
resources [p].attrs = attribute;
resources [p].data = blob;
}
-
+*/
internal void AddTypeForwarder (Type t) {
if (t == null)
throw new ArgumentNullException ("t");
/*
* The format of the argument byte array is not documented
* so this method is impossible to implement.
+ *
+ * https://connect.microsoft.com/VisualStudio/feedback/details/95784/fatal-assemblybuilder-defineunmanagedresource-byte-and-modulebuilder-defineunmanagedresource-byte-bugs-renders-them-useless
*/
throw new NotImplementedException ();
}
}
+ if (res != null) {
+ List<Exception> exceptions = null;
+ foreach (var type in res) {
+ if (type is TypeBuilder) {
+ if (exceptions == null)
+ exceptions = new List <Exception> ();
+ exceptions.Add (new TypeLoadException (string.Format ("Type '{0}' is not finished", type.FullName)));
+ }
+ }
+ if (exceptions != null)
+ throw new ReflectionTypeLoadException (new Type [exceptions.Count], exceptions.ToArray ());
+ }
+
return res == null ? Type.EmptyTypes : res;
}
throw new NotImplementedException ();
}
-#if NET_4_0
+#if NET_4_0 || MOONLIGHT
public override Type GetType (string name, bool throwOnError, bool ignoreCase)
{
if (name == null)
Module[] modules = GetModulesInternal ();
if (!getResourceModules) {
- ArrayList result = new ArrayList (modules.Length);
+ var result = new List<Module> (modules.Length);
foreach (Module m in modules)
if (!m.IsResource ())
result.Add (m);
- return (Module[])result.ToArray (typeof (Module));
+ return result.ToArray ();
}
return modules;
}
return false;
}
}
+
+ public override bool IsDynamic {
+ get { return true; }
+ }
#endif
}
}