Question

I'm a relatively new employee at my current company, so I'm still "drinking from the fire hose" in terms of learning my way around the software and architecture. I've found myself dealing with some very large objects while writing unit tests, let's say for discussion a "SavedOrder", and I need to find where to find a particular piece of data I'm looking for.

The problem I'm having is that I know that each SavedOrder has, somewhere in the innards of it's inheritances and members (who have members, of whom have members, and so on and so on), the piece of data I'm looking for.

For now I find myself mindlessly expanding my watches and mousing over the objects to hopefully find what I'm looking for. Does anybody know of a plugin/technique to use to find if this object has something of "Type A" or something of value "SomeEnum.SomeValue"?

EDIT: All good input, nothing yet that completely solves my goal. The object browsers (Object Browser and Reflector) do a good job of browsing the members of each object, but in the goal of linking point A to point D, they really just help in bringing point A to point B or D to C.

I guess the pseudo c# recursive algorithm that would best describe a solution would be:

WheresWaldo FindMember(Object o)
{
    foreach(PublicMember member in o)
    {
         if(o.IsType(MyType))
            return Success!;
         else
            return WheresWaldo(member);
    }


}

Who knows, maybe not possible.

Was it helpful?

Solution

I am not sure I follow you completely, but perhaps you could use a conditional break point. Set a break point on the relevant code, right click and select conditional break point. From here you can write a piece of code, that will be evaluated each time the break point is evaluated. That way you can specify to only stop when the condition is met.

EDIT: Based on your comments, I would say that Reflector may be useful. It has the option to search for specific types or members. Launch Reflector with you relevant assemblies. Press F3 for search and select Ctrl-M for members and type the name of the member you're looking for. You can toggle exact match on/off to help you with the search.

OTHER TIPS

ObjectBrowser is probably what you want to use. You can search for properties using that.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top