After adding Generics support to my Forms + creating abstract Form , the Designer stopped working with one of those "ugly design-time errors" , which BTW are very nicely shown in vs.net 2008.
So my conclusion is : neither vs.net 2005 nor vs.net 2008 can easily support Generics + USer Control (or forms) inheritance (they both share this same "bug" / limitation ).
Luckily I found this workaournd from Frank Bakker .I could work-around and create a common/base UserControl for my Business Object UI.
Code Example:
public partial class ProductFormUC : ProductFormUCDummy
{
public ProductFormUC() : base()
{
InitializeComponent();
}
public ProductFormUC(int pProductID) : this()
{
Product product = this.Repository.ProductDAO.Fetch(pProductID);
if (product == null)
throw new Exception("Not Found : was it deleted? improve this case");
SetCurrentBO(product);
categoryBindingSource.DataSource = this.Repository.CategoriesDAO.GetAll();
categoryBindingSource.DataMember = "CategoryName";
productBindingSource.DataSource = product;
}
}
This "intermediate" class makes the trick :
public partial class ProductFormUCDummy : BaseBOFormUC
{
protected override IDAO
{
get { return this.Repository.ProductDAO; }
}
}
4 comments:
Genial post and this post helped me alot in my college assignement. Say thank you you seeking your information.
[b]Prestigio 5120[/b]
Prestigio GeoVision 5120 – это современные GPS-навигаторы с большим экраном, которые позволят Вам добираться до пункта назначения с минимальными усилиями и затратами. Эти устройства достаточно компактны. Их можно везде носить с собой или быстро установить в автомобиле для дорожной навигации. GPS-навигаторы Prestigio GeoVision 5120 позволят Вам путешествовать легко и без ограничений, кроме того, они удивят Вас набором мультимедийных функций, что позволит Вам приятно провести время в долгой дороге.
[url=http://info.je1.ru/GPS_003.html]Подробнее...[/url]
Хорошая статья. Действительно было интересно почитать. Не часто такое и встречается та.Наверное стоит подписаться на ваше RSS
Nice work very professional weblog!!
viagra online
generic viagra
thanks for sharing!!!
Post a Comment