On Wed, 2009-09-30 at 04:44 -0700, [email protected] wrote:
> My problem is that i need to know if a member is explicitly
> implemented from an interface

'mdoc update' does this with:

        public static bool IsExplicitlyImplemented (MethodDefinition
        method)
        {
            return method.IsPrivate && method.IsFinal &&
        method.IsVirtual;
        }

>  and if so what is that interface.

'mdoc update' does this with:

        public static void GetInfoForExplicitlyImplementedMethod (
                        MethodDefinition method, out TypeReference iface, out 
MethodReference ifaceMethod)
        {
                iface = null;
                ifaceMethod = null;
                if (method.Overrides.Count != 1)
                        throw new InvalidOperationException ("Could not 
determine interface type for explicitly-implemented interface member " + 
method.Name);
                iface = method.Overrides [0].DeclaringType;
                ifaceMethod = method.Overrides [0];
        }

 - Jon



--~--~---------~--~----~------------~-------~--~----~
--
mono-cecil
-~----------~----~----~----~------~----~------~--~---

Reply via email to