API Question #1

Does anyone know what this method does/means

public System.Boolean ImplementsExplicitly ( Microsoft.Cci.Method meth )
Member of Microsoft.Cci.TypeNode

 



Answer this question

API Question #1

  • Aner Ben-Artzi

    This helper tells you whether a method has been implemented explicitly on a class. For example:

    void IDisposable.Dispose() { return; }

    A call to ImplementsExplicitly on the method above would return true.

    Note that this is an expensive call to me and will cause information to be cached. It might be worth making the call for a type w/a large number of members/explicitly implemented items. No FxCop rule currently calls this helper and we don't guarantee that it will continue to exist in future versions of the tool.

    You might find it more straightforward to look at the ImplementedInterfaceMethods on a method. If this value is non-null, the method under analysis is used to explicitly implement at least one interface method. (In a language such as VB, the same method can be used to implement an arbitrary number of interface methods that share a common signature).

  • Chad Wach

    Thanks so much for your reply. You gave me exactly what I was looking for and answered the same question about the ImplementedInterfaceMethods method that I was thinking about posting! There are other API specific questions I have and if it's OK with you I might post them. Don't worry, I won't flood the forum with these questions. Usually the API in question is a method or property that I feel may be able to solve my problem more easily or quickly, a possible shortcut to a solution, but I'm just not sure. What I'd like to avoid is looping over multiple collections looking for information that is available through a simple call or a couple of property checks...know what I mean Thanks again.

  • Derek Newkirk

    Post away! That's what the forum is here for. 8)

  • API Question #1