【使い方】
例:プロパティ「Pages」に設定したカスタムコレクション(CustomCollection)を永続化する。
/// <summary>
/// カスタムコントロールクラス。
/// </summary>
[ParseChildren(true, "Pages"),
ToolboxData("<{0}:TabControl runat=server></{0}:TabControl>")]
public class TabControl : System.Web.UI.WebControls.WebControl
{
・・・・・・
private myCustomCollection = new CustomCollection();
・・・・・・
/// <summary>
/// カスタムコレクションを表すオブジェクトを取得します。
/// </summary>
[MergableProperty(false),
PersistenceMode(PersistenceMode.InnerDefaultProperty),
Description("カスタムコレクションを表すオブジェクトを取得します。"), Category("データ")]
public CustomCollection Pages
{
get {return myCustomCollection;}
}
・・・・・・
}
|