Author: jbevain
Date: 2007-06-20 16:34:41 -0400 (Wed, 20 Jun 2007)
New Revision: 80363

Added:
   trunk/cecil/lib/Mono.Cecil/DefaultImporter.cs
   trunk/cecil/lib/Mono.Cecil/IImporter.cs
Removed:
   trunk/cecil/lib/Mono.Cecil/DefaultReferenceImporter.cs
   trunk/cecil/lib/Mono.Cecil/IReferenceImporter.cs
Modified:
   trunk/cecil/lib/ChangeLog
   trunk/cecil/lib/Mono.Cecil.csproj
   trunk/cecil/lib/Mono.Cecil.dll.sources
   trunk/cecil/lib/Mono.Cecil/ImportContext.cs
   trunk/cecil/lib/Mono.Cecil/ModuleDefinition.cs
   trunk/cecil/lib/Mono.Cecil/NullReferenceImporter.cs
   trunk/cecil/lib/Mono.Cecil/ReflectionController.cs
Log:
2007-06-20  Jb Evain  <[EMAIL PROTECTED]>

        * Mono.Cecil/IReferenceImporter.cs => IImporter.cs
          Mono.Cecil/DefaultReferenceImporter.cs => DefaultImporter.cs


Modified: trunk/cecil/lib/ChangeLog
===================================================================
--- trunk/cecil/lib/ChangeLog   2007-06-20 20:33:16 UTC (rev 80362)
+++ trunk/cecil/lib/ChangeLog   2007-06-20 20:34:41 UTC (rev 80363)
@@ -1,5 +1,8 @@
 2007-06-20  Jb Evain  <[EMAIL PROTECTED]>
 
+       * Mono.Cecil/IReferenceImporter.cs => IImporter.cs
+         Mono.Cecil/DefaultReferenceImporter.cs => DefaultImporter.cs
+
        * Mono.Cecil/ReflectionHelper.cs
          Mono.Cecil/DefaultReferenceImporter.cs
          Mono.Cecil/ModuleDefinition.cs:

Copied: trunk/cecil/lib/Mono.Cecil/DefaultImporter.cs (from rev 80359, 
trunk/cecil/lib/Mono.Cecil/DefaultReferenceImporter.cs)
===================================================================
--- trunk/cecil/lib/Mono.Cecil/DefaultReferenceImporter.cs      2007-06-20 
20:11:22 UTC (rev 80359)
+++ trunk/cecil/lib/Mono.Cecil/DefaultImporter.cs       2007-06-20 20:34:41 UTC 
(rev 80363)
@@ -0,0 +1,229 @@
+//
+// DefaultReferenceImporter.cs
+//
+// Author:
+//   Jb Evain ([EMAIL PROTECTED])
+//
+// (C) 2007 Jb Evain
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+namespace Mono.Cecil {
+
+       using System;
+       using System.Collections;
+
+       public class DefaultImporter : IImporter {
+
+               ModuleDefinition m_module;
+
+               public ModuleDefinition Module {
+                       get { return m_module; }
+               }
+
+               public DefaultImporter (ModuleDefinition module)
+               {
+                       m_module = module;
+               }
+
+               public AssemblyNameReference ImportAssembly 
(AssemblyNameReference asm)
+               {
+                       AssemblyNameReference asmRef = GetAssemblyNameReference 
(asm);
+                       if (asmRef != null)
+                               return asmRef;
+
+                       asmRef = new AssemblyNameReference (
+                               asm.Name, asm.Culture, asm.Version);
+                       asmRef.PublicKeyToken = asm.PublicKeyToken;
+                       asmRef.HashAlgorithm = asm.HashAlgorithm;
+                       m_module.AssemblyReferences.Add (asmRef);
+                       return asmRef;
+               }
+
+               AssemblyNameReference GetAssemblyNameReference 
(AssemblyNameReference asm)
+               {
+                       foreach (AssemblyNameReference reference in 
m_module.AssemblyReferences)
+                               if (reference.FullName == asm.FullName)
+                                       return reference;
+
+                       return null;
+               }
+
+               TypeReference GetTypeSpec (TypeReference t, ImportContext 
context)
+               {
+                       Stack s = new Stack ();
+                       while (t is TypeSpecification) {
+                               s.Push (t);
+                               t = (t as TypeSpecification).ElementType;
+                       }
+
+                       TypeReference elementType = ImportTypeReference (t, 
context);
+                       while (s.Count > 0) {
+                               t = (TypeReference) s.Pop ();
+                               if (t is PointerType)
+                                       elementType = new PointerType 
(elementType);
+                               else if (t is ArrayType) // deal with complex 
arrays
+                                       elementType = new ArrayType 
(elementType);
+                               else if (t is ReferenceType)
+                                       elementType = new ReferenceType 
(elementType);
+                               else if (t is GenericInstanceType) {
+                                       GenericInstanceType git = t as 
GenericInstanceType;
+                                       GenericInstanceType genElemType = new 
GenericInstanceType (elementType);
+                                       foreach (TypeReference arg in 
git.GenericArguments)
+                                               
genElemType.GenericArguments.Add (ImportTypeReference (arg, context));
+
+                                       elementType = genElemType;
+                               } else
+                                       throw new ReflectionException ("Unknown 
element type: {0}", t.GetType ().Name);
+                       }
+
+                       return elementType;
+               }
+
+               static GenericParameter GetGenericParameter (GenericParameter 
gp, ImportContext context)
+               {
+                       GenericParameter p;
+                       if (gp.Owner is TypeReference)
+                               p = 
context.GenericContext.Type.GenericParameters [gp.Position];
+                       else if (gp.Owner is MethodReference)
+                               p = 
context.GenericContext.Method.GenericParameters [gp.Position];
+                       else
+                               throw new NotSupportedException ();
+
+                       return p;
+               }
+
+               public virtual TypeReference ImportTypeReference (TypeReference 
t, ImportContext context)
+               {
+                       if (t.Module == m_module)
+                               return t;
+
+                       if (t is TypeSpecification)
+                               return GetTypeSpec (t, context);
+
+                       if (t is GenericParameter)
+                               return GetGenericParameter (t as 
GenericParameter, context);
+
+                       TypeReference type = m_module.TypeReferences 
[t.FullName];
+                       if (type != null)
+                               return type;
+
+                       AssemblyNameReference asm;
+                       if (t.Scope is AssemblyNameReference)
+                               asm = ImportAssembly ((AssemblyNameReference) 
t.Scope);
+                       else if (t.Scope is ModuleDefinition)
+                               asm = ImportAssembly (((ModuleDefinition) 
t.Scope).Assembly.Name);
+                       else
+                               throw new NotImplementedException ();
+
+                       type = new TypeReference (t.Name, t.Namespace, asm, 
t.IsValueType);
+
+                       context.GenericContext.Type = type;
+
+                       foreach (GenericParameter gp in t.GenericParameters)
+                               type.GenericParameters.Add 
(GenericParameter.Clone (gp, context));
+
+                       m_module.TypeReferences.Add (type);
+                       return type;
+               }
+
+               public virtual FieldReference ImportFieldReference 
(FieldReference fr, ImportContext context)
+               {
+                       if (fr.DeclaringType.Module == m_module)
+                               return fr;
+
+                       FieldReference field = (FieldReference) 
GetMemberReference (fr);
+                       if (field != null)
+                               return field;
+
+                       field = new FieldReference (
+                               fr.Name,
+                               ImportTypeReference (fr.DeclaringType, context),
+                               ImportTypeReference (fr.FieldType, context));
+
+                       m_module.MemberReferences.Add (field);
+                       return field;
+               }
+
+               MethodReference GetMethodSpec (MethodReference meth, 
ImportContext context)
+               {
+                       if (!(meth is GenericInstanceMethod))
+                               return null;
+
+                       GenericInstanceMethod gim = meth as 
GenericInstanceMethod;
+                       GenericInstanceMethod ngim = new GenericInstanceMethod (
+                               ImportMethodReference (gim.ElementMethod, 
context));
+
+                       foreach (TypeReference arg in gim.GenericArguments)
+                               ngim.GenericArguments.Add (ImportTypeReference 
(arg, context));
+
+                       return ngim;
+               }
+
+               public virtual MethodReference ImportMethodReference 
(MethodReference mr, ImportContext context)
+               {
+                       if (mr.DeclaringType.Module == m_module)
+                               return mr;
+
+                       if (mr is MethodSpecification)
+                               return GetMethodSpec (mr, context);
+
+                       MethodReference meth = (MethodReference) 
GetMemberReference (mr);
+                       if (meth != null)
+                               return meth;
+
+                       meth = new MethodReference (
+                               mr.Name,
+                               mr.HasThis,
+                               mr.ExplicitThis,
+                               mr.CallingConvention);
+                       meth.DeclaringType = ImportTypeReference 
(mr.DeclaringType, context);
+
+                       TypeReference contextType = meth.DeclaringType;
+                       while (contextType is TypeSpecification)
+                               contextType = (contextType as 
TypeSpecification).ElementType;
+
+                       context.GenericContext.Method = meth;
+                       context.GenericContext.Type = contextType;
+
+                       foreach (GenericParameter gp in mr.GenericParameters)
+                               meth.GenericParameters.Add 
(GenericParameter.Clone (gp, context));
+
+                       meth.ReturnType.ReturnType = ImportTypeReference 
(mr.ReturnType.ReturnType, context);
+
+                       foreach (ParameterDefinition param in mr.Parameters)
+                               meth.Parameters.Add (new ParameterDefinition (
+                                       ImportTypeReference 
(param.ParameterType, context)));
+
+                       m_module.MemberReferences.Add (meth);
+                       return meth;
+               }
+
+               MemberReference GetMemberReference (MemberReference member)
+               {
+                       foreach (MemberReference reference in 
m_module.MemberReferences)
+                               if (reference.ToString () == member.ToString ())
+                                       return reference;
+
+                       return null;
+               }
+       }
+}

Deleted: trunk/cecil/lib/Mono.Cecil/DefaultReferenceImporter.cs
===================================================================
--- trunk/cecil/lib/Mono.Cecil/DefaultReferenceImporter.cs      2007-06-20 
20:33:16 UTC (rev 80362)
+++ trunk/cecil/lib/Mono.Cecil/DefaultReferenceImporter.cs      2007-06-20 
20:34:41 UTC (rev 80363)
@@ -1,229 +0,0 @@
-//
-// DefaultReferenceImporter.cs
-//
-// Author:
-//   Jb Evain ([EMAIL PROTECTED])
-//
-// (C) 2007 Jb Evain
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-namespace Mono.Cecil {
-
-       using System;
-       using System.Collections;
-
-       public class DefaultReferenceImporter : IReferenceImporter {
-
-               ModuleDefinition m_module;
-
-               public ModuleDefinition Module {
-                       get { return m_module; }
-               }
-
-               public DefaultReferenceImporter (ModuleDefinition module)
-               {
-                       m_module = module;
-               }
-
-               public AssemblyNameReference ImportAssembly 
(AssemblyNameReference asm)
-               {
-                       AssemblyNameReference asmRef = GetAssemblyNameReference 
(asm);
-                       if (asmRef != null)
-                               return asmRef;
-
-                       asmRef = new AssemblyNameReference (
-                               asm.Name, asm.Culture, asm.Version);
-                       asmRef.PublicKeyToken = asm.PublicKeyToken;
-                       asmRef.HashAlgorithm = asm.HashAlgorithm;
-                       m_module.AssemblyReferences.Add (asmRef);
-                       return asmRef;
-               }
-
-               AssemblyNameReference GetAssemblyNameReference 
(AssemblyNameReference asm)
-               {
-                       foreach (AssemblyNameReference reference in 
m_module.AssemblyReferences)
-                               if (reference.FullName == asm.FullName)
-                                       return reference;
-
-                       return null;
-               }
-
-               TypeReference GetTypeSpec (TypeReference t, ImportContext 
context)
-               {
-                       Stack s = new Stack ();
-                       while (t is TypeSpecification) {
-                               s.Push (t);
-                               t = (t as TypeSpecification).ElementType;
-                       }
-
-                       TypeReference elementType = ImportTypeReference (t, 
context);
-                       while (s.Count > 0) {
-                               t = (TypeReference) s.Pop ();
-                               if (t is PointerType)
-                                       elementType = new PointerType 
(elementType);
-                               else if (t is ArrayType) // deal with complex 
arrays
-                                       elementType = new ArrayType 
(elementType);
-                               else if (t is ReferenceType)
-                                       elementType = new ReferenceType 
(elementType);
-                               else if (t is GenericInstanceType) {
-                                       GenericInstanceType git = t as 
GenericInstanceType;
-                                       GenericInstanceType genElemType = new 
GenericInstanceType (elementType);
-                                       foreach (TypeReference arg in 
git.GenericArguments)
-                                               
genElemType.GenericArguments.Add (ImportTypeReference (arg, context));
-
-                                       elementType = genElemType;
-                               } else
-                                       throw new ReflectionException ("Unknown 
element type: {0}", t.GetType ().Name);
-                       }
-
-                       return elementType;
-               }
-
-               static GenericParameter GetGenericParameter (GenericParameter 
gp, ImportContext context)
-               {
-                       GenericParameter p;
-                       if (gp.Owner is TypeReference)
-                               p = 
context.GenericContext.Type.GenericParameters [gp.Position];
-                       else if (gp.Owner is MethodReference)
-                               p = 
context.GenericContext.Method.GenericParameters [gp.Position];
-                       else
-                               throw new NotSupportedException ();
-
-                       return p;
-               }
-
-               public virtual TypeReference ImportTypeReference (TypeReference 
t, ImportContext context)
-               {
-                       if (t.Module == m_module)
-                               return t;
-
-                       if (t is TypeSpecification)
-                               return GetTypeSpec (t, context);
-
-                       if (t is GenericParameter)
-                               return GetGenericParameter (t as 
GenericParameter, context);
-
-                       TypeReference type = m_module.TypeReferences 
[t.FullName];
-                       if (type != null)
-                               return type;
-
-                       AssemblyNameReference asm;
-                       if (t.Scope is AssemblyNameReference)
-                               asm = ImportAssembly ((AssemblyNameReference) 
t.Scope);
-                       else if (t.Scope is ModuleDefinition)
-                               asm = ImportAssembly (((ModuleDefinition) 
t.Scope).Assembly.Name);
-                       else
-                               throw new NotImplementedException ();
-
-                       type = new TypeReference (t.Name, t.Namespace, asm, 
t.IsValueType);
-
-                       context.GenericContext.Type = type;
-
-                       foreach (GenericParameter gp in t.GenericParameters)
-                               type.GenericParameters.Add 
(GenericParameter.Clone (gp, context));
-
-                       m_module.TypeReferences.Add (type);
-                       return type;
-               }
-
-               public virtual FieldReference ImportFieldReference 
(FieldReference fr, ImportContext context)
-               {
-                       if (fr.DeclaringType.Module == m_module)
-                               return fr;
-
-                       FieldReference field = (FieldReference) 
GetMemberReference (fr);
-                       if (field != null)
-                               return field;
-
-                       field = new FieldReference (
-                               fr.Name,
-                               ImportTypeReference (fr.DeclaringType, context),
-                               ImportTypeReference (fr.FieldType, context));
-
-                       m_module.MemberReferences.Add (field);
-                       return field;
-               }
-
-               MethodReference GetMethodSpec (MethodReference meth, 
ImportContext context)
-               {
-                       if (!(meth is GenericInstanceMethod))
-                               return null;
-
-                       GenericInstanceMethod gim = meth as 
GenericInstanceMethod;
-                       GenericInstanceMethod ngim = new GenericInstanceMethod (
-                               ImportMethodReference (gim.ElementMethod, 
context));
-
-                       foreach (TypeReference arg in gim.GenericArguments)
-                               ngim.GenericArguments.Add (ImportTypeReference 
(arg, context));
-
-                       return ngim;
-               }
-
-               public virtual MethodReference ImportMethodReference 
(MethodReference mr, ImportContext context)
-               {
-                       if (mr.DeclaringType.Module == m_module)
-                               return mr;
-
-                       if (mr is MethodSpecification)
-                               return GetMethodSpec (mr, context);
-
-                       MethodReference meth = (MethodReference) 
GetMemberReference (mr);
-                       if (meth != null)
-                               return meth;
-
-                       meth = new MethodReference (
-                               mr.Name,
-                               mr.HasThis,
-                               mr.ExplicitThis,
-                               mr.CallingConvention);
-                       meth.DeclaringType = ImportTypeReference 
(mr.DeclaringType, context);
-
-                       TypeReference contextType = meth.DeclaringType;
-                       while (contextType is TypeSpecification)
-                               contextType = (contextType as 
TypeSpecification).ElementType;
-
-                       context.GenericContext.Method = meth;
-                       context.GenericContext.Type = contextType;
-
-                       foreach (GenericParameter gp in mr.GenericParameters)
-                               meth.GenericParameters.Add 
(GenericParameter.Clone (gp, context));
-
-                       meth.ReturnType.ReturnType = ImportTypeReference 
(mr.ReturnType.ReturnType, context);
-
-                       foreach (ParameterDefinition param in mr.Parameters)
-                               meth.Parameters.Add (new ParameterDefinition (
-                                       ImportTypeReference 
(param.ParameterType, context)));
-
-                       m_module.MemberReferences.Add (meth);
-                       return meth;
-               }
-
-               MemberReference GetMemberReference (MemberReference member)
-               {
-                       foreach (MemberReference reference in 
m_module.MemberReferences)
-                               if (reference.ToString () == member.ToString ())
-                                       return reference;
-
-                       return null;
-               }
-       }
-}

Copied: trunk/cecil/lib/Mono.Cecil/IImporter.cs (from rev 79981, 
trunk/cecil/lib/Mono.Cecil/IReferenceImporter.cs)
===================================================================
--- trunk/cecil/lib/Mono.Cecil/IReferenceImporter.cs    2007-06-18 08:22:25 UTC 
(rev 79981)
+++ trunk/cecil/lib/Mono.Cecil/IImporter.cs     2007-06-20 20:34:41 UTC (rev 
80363)
@@ -0,0 +1,37 @@
+//
+// IImporter.cs
+//
+// Author:
+//   Jb Evain ([EMAIL PROTECTED])
+//
+// (C) 2007 Jb Evain
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+namespace Mono.Cecil {
+
+       public interface IImporter {
+
+               TypeReference ImportTypeReference (TypeReference type, 
ImportContext context);
+               FieldReference ImportFieldReference (FieldReference field, 
ImportContext context);
+               MethodReference ImportMethodReference (MethodReference method, 
ImportContext context);
+       }
+}

Deleted: trunk/cecil/lib/Mono.Cecil/IReferenceImporter.cs
===================================================================
--- trunk/cecil/lib/Mono.Cecil/IReferenceImporter.cs    2007-06-20 20:33:16 UTC 
(rev 80362)
+++ trunk/cecil/lib/Mono.Cecil/IReferenceImporter.cs    2007-06-20 20:34:41 UTC 
(rev 80363)
@@ -1,37 +0,0 @@
-//
-// IReferenceImporter.cs
-//
-// Author:
-//   Jb Evain ([EMAIL PROTECTED])
-//
-// (C) 2007 Jb Evain
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-namespace Mono.Cecil {
-
-       public interface IReferenceImporter {
-
-               TypeReference ImportTypeReference (TypeReference type, 
ImportContext context);
-               FieldReference ImportFieldReference (FieldReference field, 
ImportContext context);
-               MethodReference ImportMethodReference (MethodReference method, 
ImportContext context);
-       }
-}

Modified: trunk/cecil/lib/Mono.Cecil/ImportContext.cs
===================================================================
--- trunk/cecil/lib/Mono.Cecil/ImportContext.cs 2007-06-20 20:33:16 UTC (rev 
80362)
+++ trunk/cecil/lib/Mono.Cecil/ImportContext.cs 2007-06-20 20:34:41 UTC (rev 
80363)
@@ -31,19 +31,19 @@
        public class ImportContext {
 
                GenericContext m_genContext;
-               IReferenceImporter m_importer;
+               IImporter m_importer;
 
                public GenericContext GenericContext {
                        get { return m_genContext; }
                }
 
-               public ImportContext (IReferenceImporter importer)
+               public ImportContext (IImporter importer)
                {
                        m_genContext = new GenericContext ();
                        m_importer = importer;
                }
 
-               public ImportContext (IReferenceImporter importer, 
IGenericParameterProvider provider)
+               public ImportContext (IImporter importer, 
IGenericParameterProvider provider)
                {
                        m_importer = importer;
                        m_genContext = new GenericContext (provider);

Modified: trunk/cecil/lib/Mono.Cecil/ModuleDefinition.cs
===================================================================
--- trunk/cecil/lib/Mono.Cecil/ModuleDefinition.cs      2007-06-20 20:33:16 UTC 
(rev 80362)
+++ trunk/cecil/lib/Mono.Cecil/ModuleDefinition.cs      2007-06-20 20:34:41 UTC 
(rev 80363)
@@ -202,7 +202,7 @@
                        return new ImportContext (m_controller.Importer);
                }
 
-               static ImportContext GetContext (IReferenceImporter importer)
+               static ImportContext GetContext (IImporter importer)
                {
                        return new ImportContext (importer);
                }
@@ -212,7 +212,7 @@
                        return new ImportContext (m_controller.Importer, 
context);
                }
 
-               static ImportContext GetContext (IReferenceImporter importer, 
TypeDefinition context)
+               static ImportContext GetContext (IImporter importer, 
TypeDefinition context)
                {
                        return new ImportContext (importer, context);
                }
@@ -349,7 +349,7 @@
                        return Inject (type, m_controller.Importer);
                }
 
-               public TypeDefinition Inject (TypeDefinition type, 
IReferenceImporter importer)
+               public TypeDefinition Inject (TypeDefinition type, IImporter 
importer)
                {
                        if (type == null)
                                throw new ArgumentNullException ("type");
@@ -366,7 +366,7 @@
                        return Inject (type, context, m_controller.Importer);
                }
 
-               public TypeDefinition Inject (TypeDefinition type, 
TypeDefinition context, IReferenceImporter importer)
+               public TypeDefinition Inject (TypeDefinition type, 
TypeDefinition context, IImporter importer)
                {
                        Check (type, context, importer);
 
@@ -380,7 +380,7 @@
                        return Inject (meth, context, m_controller.Importer);
                }
 
-               void Check (IMemberDefinition definition, TypeDefinition 
context, IReferenceImporter importer)
+               void Check (IMemberDefinition definition, TypeDefinition 
context, IImporter importer)
                {
                        if (definition == null)
                                throw new ArgumentNullException ("definition");
@@ -392,7 +392,7 @@
                                throw new ArgumentException ("The context 
parameter does not belongs to this module");
                }
 
-               public MethodDefinition Inject (MethodDefinition meth, 
TypeDefinition context, IReferenceImporter importer)
+               public MethodDefinition Inject (MethodDefinition meth, 
TypeDefinition context, IImporter importer)
                {
                        Check (meth, context, importer);
 
@@ -401,7 +401,7 @@
                        return definition;
                }
 
-               public FieldDefinition Inject (FieldDefinition field, 
TypeDefinition context, IReferenceImporter importer)
+               public FieldDefinition Inject (FieldDefinition field, 
TypeDefinition context, IImporter importer)
                {
                        Check (field, context, importer);
 

Modified: trunk/cecil/lib/Mono.Cecil/NullReferenceImporter.cs
===================================================================
--- trunk/cecil/lib/Mono.Cecil/NullReferenceImporter.cs 2007-06-20 20:33:16 UTC 
(rev 80362)
+++ trunk/cecil/lib/Mono.Cecil/NullReferenceImporter.cs 2007-06-20 20:34:41 UTC 
(rev 80363)
@@ -28,7 +28,7 @@
 
 namespace Mono.Cecil {
 
-       class NullReferenceImporter : IReferenceImporter {
+       class NullReferenceImporter : IImporter {
 
                public static readonly NullReferenceImporter Instance = new 
NullReferenceImporter ();
 

Modified: trunk/cecil/lib/Mono.Cecil/ReflectionController.cs
===================================================================
--- trunk/cecil/lib/Mono.Cecil/ReflectionController.cs  2007-06-20 20:33:16 UTC 
(rev 80362)
+++ trunk/cecil/lib/Mono.Cecil/ReflectionController.cs  2007-06-20 20:34:41 UTC 
(rev 80363)
@@ -33,7 +33,7 @@
                ReflectionReader m_reader;
                ReflectionWriter m_writer;
                ReflectionHelper m_helper;
-               DefaultReferenceImporter m_importer;
+               DefaultImporter m_importer;
 
                public ReflectionReader Reader {
                        get { return m_reader; }
@@ -47,7 +47,7 @@
                        get { return m_helper; }
                }
 
-               public IReferenceImporter Importer {
+               public IImporter Importer {
                        get { return m_importer; }
                }
 
@@ -56,7 +56,7 @@
                        m_reader = new AggressiveReflectionReader (module);
                        m_writer = new ReflectionWriter (module);
                        m_helper = new ReflectionHelper (module);
-                       m_importer = new DefaultReferenceImporter (module);
+                       m_importer = new DefaultImporter (module);
                }
        }
 }

Modified: trunk/cecil/lib/Mono.Cecil.csproj
===================================================================
--- trunk/cecil/lib/Mono.Cecil.csproj   2007-06-20 20:33:16 UTC (rev 80362)
+++ trunk/cecil/lib/Mono.Cecil.csproj   2007-06-20 20:34:41 UTC (rev 80363)
@@ -240,7 +240,7 @@
     <Compile Include="Mono.Cecil\CustomAttribute.cs" />
     <Compile Include="Mono.Cecil\CustomAttributeCollection.cs" />
     <Compile Include="Mono.Cecil\DefaultAssemblyResolver.cs" />
-    <Compile Include="Mono.Cecil\DefaultReferenceImporter.cs" />
+    <Compile Include="Mono.Cecil\DefaultImporter.cs" />
     <Compile Include="Mono.Cecil\EmbeddedResource.cs" />
     <Compile Include="Mono.Cecil\EventAttributes.cs" />
     <Compile Include="Mono.Cecil\EventDefinition.cs" />
@@ -270,6 +270,7 @@
     <Compile Include="Mono.Cecil\IHasConstant.cs" />
     <Compile Include="Mono.Cecil\IHasMarshalSpec.cs" />
     <Compile Include="Mono.Cecil\IHasSecurity.cs" />
+    <Compile Include="Mono.Cecil\IImporter.cs" />
     <Compile Include="Mono.Cecil\IMemberDefinition.cs" />
     <Compile Include="Mono.Cecil\IMemberReference.cs" />
     <Compile Include="Mono.Cecil\IMetadataScope.cs" />
@@ -277,7 +278,6 @@
     <Compile Include="Mono.Cecil\IMethodSignature.cs" />
     <Compile Include="Mono.Cecil\ImportContext.cs" />
     <Compile Include="Mono.Cecil\InterfaceCollection.cs" />
-    <Compile Include="Mono.Cecil\IReferenceImporter.cs" />
     <Compile Include="Mono.Cecil\IReflectionStructureVisitable.cs" />
     <Compile Include="Mono.Cecil\IReflectionStructureVisitor.cs" />
     <Compile Include="Mono.Cecil\IReflectionVisitable.cs" />

Modified: trunk/cecil/lib/Mono.Cecil.dll.sources
===================================================================
--- trunk/cecil/lib/Mono.Cecil.dll.sources      2007-06-20 20:33:16 UTC (rev 
80362)
+++ trunk/cecil/lib/Mono.Cecil.dll.sources      2007-06-20 20:34:41 UTC (rev 
80363)
@@ -24,7 +24,7 @@
 ./Mono.Cecil/CustomAttribute.cs
 ./Mono.Cecil/CustomAttributeCollection.cs
 ./Mono.Cecil/DefaultAssemblyResolver.cs
-./Mono.Cecil/DefaultReferenceImporter.cs
+./Mono.Cecil/DefaultImporter.cs
 ./Mono.Cecil/EmbeddedResource.cs
 ./Mono.Cecil/EventAttributes.cs
 ./Mono.Cecil/EventDefinition.cs
@@ -54,6 +54,7 @@
 ./Mono.Cecil/IHasConstant.cs
 ./Mono.Cecil/IHasMarshalSpec.cs
 ./Mono.Cecil/IHasSecurity.cs
+./Mono.Cecil/IImporter.cs
 ./Mono.Cecil/IMemberDefinition.cs
 ./Mono.Cecil/IMemberReference.cs
 ./Mono.Cecil/IMetadataScope.cs
@@ -61,7 +62,6 @@
 ./Mono.Cecil/IMethodSignature.cs
 ./Mono.Cecil/ImportContext.cs
 ./Mono.Cecil/InterfaceCollection.cs
-./Mono.Cecil/IReferenceImporter.cs
 ./Mono.Cecil/IReflectionStructureVisitable.cs
 ./Mono.Cecil/IReflectionStructureVisitor.cs
 ./Mono.Cecil/IReflectionVisitable.cs

_______________________________________________
Mono-patches maillist  -  [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches

Reply via email to