I'm trying to find the usage of a property in a class where the property belongs to a base class. Here is a token example:
class Program
{
class Item
{
public DateTime DeletedStamp { get; set; }
public decimal Price { get; set; }
}
class Book : Item
{
public string Title { get; set; }
public string Author { get; set; }
}
class Bicycle : Item
{
public string Type { get; set; }
public string Producer { get; set; }
}
static void Main(string[] args)
{
var book = new Book()
{
Title = "Atlas Shrugged",
Author = "Ayn Rand",
Price = 2.99M
};
var bicycle = new Bicycle()
{
Type = "Mountain bike",
Price = 499.99M,
Producer = "Biker Ben",
DeletedStamp = DateTime.Now
};
Console.WriteLine(book.Title);
Console.WriteLine(book.Price);
Console.WriteLine(bicycle.Price);
Console.WriteLine(bicycle.DeletedStamp);
}
}
If I want to find the usage of Price in only bicycle items I find that I'm out of luck. I'm using re-sharper in Visual Studio 2013 and Find Usage finds all usage of Price including the usage in Book. This is a small example but with a base class used in a lot of other classes it becomes impossible to track down usages.
I'm looking for any tip, trick, extension or magic spell to solve this dilemma.