BLOG main image
분류 전체보기 (68)
excel.101 (0)
rewind (9)
(3)
(2)
목공 (3)
(3)
me2day (0)
The Ethereal Void (9)
코드 (14)
귀찮은것 (0)
Visitors up to today!
Today hit, Yesterday hit
daisy rss
tistory 티스토리 가입하기!
'c# ide generic form'에 해당되는 글 1건
2009. 6. 28. 20:41
물론 방법론적으로나, 유지보수 측면에서 FormEx<TClass> : System.Windows.Forms.Form (혹은 UserControl)와 같은 디자인은 그다지 좋은 디자인 방법은 아니지만, 간혹 사용해야 될 경우가 있다.

문제는 코드 자체가 아니라 디자인타임에서 Generic Form이 정상적으로 표시되지 않는 문제가 있는 것.
이럴 때는 다음과 같은 방법으로 살짝 IDE를 속일 수 있다.

#FormEx.cs
/* Base Class */
public partial class FormEx<TClass> : System.Windows.Forms.Form
{
} 

#FormCustomEx.cs
/* 마지막으로.. : ) */
public partial class FormCustomEx : FormCustom
{
} 

/* 여기서 상속을 받아.. */
public partial class FormCustom : FormEx { }

약간 IDE Hack에 가깝지만, 간혹 유용한 경우가 있다. 

refs::
반응형
prev"" #1 next