/*
The contents of this file are subject to the Mozilla Public License Version 1.1 (the "License");
you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.mozilla.org/MPL/
Software distributed under the License is distributed on an "AS IS" basis,
WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for the specific language
governing rights and limitations under the License.
The Original Code is RAIL(Runtime Assembly Instrumentation Library) Alpha Version.
The Initial Developer of the Original Code is University of Coimbra,
Computer Science Department, Dependable Systems Group. Copyright (C) University of Coimbra.
All Rights Reserved.
*/
using System;
using System.Collections;
using System.Diagnostics;
using Mono.PEToolkit;
using Mono.PEToolkit.Metadata;
using Rail.Reflect;
namespace Rail.MSIL{
/// <summary>
///
/// </summary>
internal class MethodLoadContext
{
/***************************
* Global context used for loading all types.
* Created in the constructor and not changed thereafter
****************************/
/// <summary>
///
/// </summary>
internal readonly Image asmLoader;
/// <summary>
///
/// </summary>
internal readonly RAssemblyDef asmRail;
/// <summary>
///
/// </summary>
internal readonly MetadataResolver paramResolver;
/// <summary>
///
/// </summary>
/// <param name="asmLoader"></param>
/// <param name="asmRail"></param>
internal MethodLoadContext(Image asmLoader, RAssemblyDef asmRail)
{
if (asmLoader == null)
throw new InvalidProgramException();
if (asmRail == null)
throw new InvalidProgramException();
this.asmLoader = asmLoader;
this.asmRail = asmRail;
this.paramResolver = new MetadataResolver(asmLoader, asmRail);
}
}
}
|