This code seems to handle this:
private static bool CheckTypes(TypeReference type1, TypeReference
type2)
{
var genType = type1 as GenericInstanceType;
if (genType != null && genType.GenericArguments.Contains(type2))
return true;
return type1 == type2;
}
At least it does handle code like:
public class SomeClass:List<SomeType> {}
Lev
On 17 июл, 20:20, "Jair Cazarin" <[EMAIL PROTECTED]> wrote:
> ok, and what about the case of Cls:SomeGeneric<C>
>
>
>
> On Thu, Jul 17, 2008 at 5:28 AM, Lev <[EMAIL PROTECTED]> wrote:
>
> > Hi, Jair,
>
> > As far as I understand you mean ModuleDefinition.AssemblyReferences
> > and ModuleDefinition.MemberReferences.
>
> > If yes, these have nothing to do with the task I solve.
>
> > As I said, the posted code checks if the _current type_ depends on the
> > _provided type_.
>
> > By the way is there an existent way to get the list of referenced type
> > for a TypeDefinition, NOT the ModuleDefnition?
>
> > Thanks,
> > Lev
>
> > Jair Cazarin:
> > > What about just looking AssemblyReferences and MemberReferences?
>
> > > --
> > > Jair Cazarin Villanueva
> > >http://jaircazarin.blogspot.com
>
> --
> Jair Cazarin Villanuevahttp://jaircazarin.blogspot.com
--~--~---------~--~----~------------~-------~--~----~
--
mono-cecil
-~----------~----~----~----~------~----~------~--~---