Please Explain "public new BankTellerWorkItem"

Topics: CAB & Smart Client Software Factory
Sep 24, 2005 at 3:39 AM
originally posted by: grsmith

I have never seen new used as below. Will someone give me a brief explanation.

public new BankTellerWorkitem workItem
{
get
{
return base.WorkItem as BankTellerWorkItem;
}
}

thanks
grs
Sep 24, 2005 at 4:32 AM
originally posted by: BradWilsonMSFT

The base class defines the property named WorkItem, which returns an object of type WorkItem.

The derived class re-defines the property named WorkItem, to return the specific type of WorkItem in which it knows it has been placed, so it won't need to constantly cast WorkItem to BankTellerWorkItem.