Welcome to MSDN Blogs Sign in | Join | Help

Finding the Base Class of a Function with Phoenix

This came up on an internal alias today, so I thought I would post the solution.

 The issue is when there is some code like the following:

    class BaseClass

    {

    }

 

    class InheritedClass : BaseClass

    {

        void SomeFunction() { }

    }

And you have a pointer to the SomeFunction function unit, how do you find out the associated base class of that function (in this case it is BaseClass).

The answer is: 

functionSymbol.EnclosingAggregateType.PrimaryBaseAggregateType

Published Monday, October 08, 2007 3:20 PM by kanggatl
Filed under:

Comment Notification

If you would like to receive an email when updates are made to this post, please register here

Subscribe to this post's comments using RSS

Comments

# Techy News Blog » Finding the Base Class of a Function with Phoenix

# re: Finding the Base Class of a Function with Phoenix

Thursday, October 11, 2007 12:35 AM by Frank

Naming them FunctionSymbol.DeclaringType.BaseType too concise?

# re: Finding the Base Class of a Function with Phoenix

Friday, October 26, 2007 8:29 PM by kanggatl

Yes, yes.  We know that some things are a bit more verbose than they should be.  

Leave a Comment

(required) 
required 
(required) 

  
Enter Code Here: Required
 
Page view tracker