Whole Tomato Software Forums
Whole Tomato Software Forums
Main Site | Profile | Register | Active Topics | Members | Search | FAQ
 All Forums
 Visual Assist
 Technical Support
 "Find reference" and inherited method

You must be registered to post a reply.
Click here to register.

Screensize:
UserName:
Password:
Format: BoldItalicizeUnderlineStrikethrough Align leftCenterAlign right Insert horizontal ruleUpload and insert imageInsert hyperlinkInsert email addressInsert codeInsert quoted textInsert listInsert Emoji
   
Message:

Forum code is on.
Html is off.

 
Check to subscribe to this topic.
   

T O P I C    R E V I E W
enigma Posted - Mar 04 2007 : 8:51:09 PM
"Find references" couldn't seem to find all the instances of virtual and inherited methods.

Let say if I have an abstract method name Demo1() (using vs.net 2003)
protected abstract Demo1();

and I inherit it in my derived classes

protected override Demo1();

Using the "find references" operation will not list down completely all the instances of "Demo1".

6   L A T E S T    R E P L I E S    (Newest First)
support Posted - Jan 31 2010 : 1:16:34 PM
case=3346 is implemented in build 1810
feline Posted - Mar 07 2007 : 08:32:31 AM
I am seeing the same thing as you now, my mistake. I managed to test the wrong thing on the wrong machine *oops*

Currently Find References does not try to scan the base classes.

This is due to the complications of multiple inheritance, plus overriding virtual functions in core library (stable include directory) classes.

case=3346
enigma Posted - Mar 06 2007 : 7:56:07 PM
Try this on vs.net 2003 standard version:
1.Type in the below code
public BaseCase()
{

}

public abstract string MyName
{
get;
}
}

public class DeriveCase1:BaseCase
{
public DeriveCase1():base()
{

}

public override string MyName
{
get
{
return GetType().ToString();
}
}
}
2.

Place your mouse cursor at MyName, and try to find references of it.

3. Observed: Only one instance is found,namely itself, its base class reference cannot be found.
4. Let say if you find to find the MyName at the base class,, VA will correctly return two instances, one in base class, another in derived class
feline Posted - Mar 06 2007 : 12:21:23 PM
using VS2005 and VA 1548 I have added the following code to a C# file:

    abstract class bug_find_references_base
    {
        protected abstract string getNameOfClass();
    }

    class bug_find_references_child : bug_find_references_base
    {
        protected override string getNameOfClass() { return "bug_find_references_child"; }

        public int getLengthOfClassName() { return getNameOfClass().Length; }
    }


when I sit in the base class and trigger Find References on "getNameOfClass" it finds all three references correctly. Is this the sort of thing you are doing, or am I testing the wrong thing?

If this is the right sort of thing can you try copy / pasting this code into one of your files and see what results you get?
enigma Posted - Mar 05 2007 : 7:43:07 PM
C#.

Sorry for not making this clear at the outset
feline Posted - Mar 05 2007 : 10:07:18 AM
What language are you programming in? This does not look like C++ to me.

© 2023 Whole Tomato Software, LLC Go To Top Of Page
Snitz Forums 2000