JB my particular situation is keeping a running cache. Would it be simpler to just do my load bringing in anything updated then just remove() all the types from the module?
On Mon, Dec 6, 2010 at 12:07 PM, Jb Evain <[email protected]> wrote: > Hey, > > On Mon, Dec 6, 2010 at 6:02 PM, Greg Young <[email protected]> > wrote: > > From a previous discussion so it ends up on the list. > > Thanks! > > > JB mentioned using module.Types.Remove(TypeDef) to detach a given > > typedefinition. Another option would be to copy into a detached version. > > I imagine that one Types.Remove(TypeDef) is called, you just won't be > able > > to walk through the module anymore which is ok. For the copying does > anyone > > happen to have a copy around? > > This solution is actually not a solution, as it will only remove the > link between the one type definition and the module, but it won't > remove the link between say, the base type of the type definition, and > the module. > > So basically, every type reference in the TypeDefinition subtree would > need to be «detached». > > > What about MethodDefs? How would they be detached? > > MethodDefinition get their module from their declaring type. The issue > would be with, for instance, their ReturnType or the ParameterType of > its parameters. > > It shouldn't be hard to write a piece of code to walk the sub tree of > a TypeDefinition to detach every type it finds. > > Jb > > -- > -- > mono-cecil -- Les erreurs de grammaire et de syntaxe ont été incluses pour m'assurer de votre attention -- -- mono-cecil
