Can C# make my class look like another class?
- by Vaccano
I have a class that look like this:
public class BasePadWI
{
public WorkItem WorkItemReference { get; set; }
.... Other stuff ......
}
I then have a dictionary that is defined like this:
public Dictionary<BasePadWI, Canvas> Pad { get; set; }
I would then like to make a call like this:
List<WorkItem> workItems = Pad.Keys.ToList();
(Note: WorkItem is a sealed class, so I cannot inherit.)
Is there some trickery that I could do in the class to make it look like a WorkItem?
I have done this in the mean time:
List<WorkItem> workItems = Pad.Keys.ToList().ConvertAll(x=>x.WorkItem);