PersistChildrenAttribute.UsesCustomPersistence プロパティとは? わかりやすく解説

Weblio 辞書 > コンピュータ > .NET Framework クラス ライブラリ リファレンス > PersistChildrenAttribute.UsesCustomPersistence プロパティの意味・解説 

PersistChildrenAttribute.UsesCustomPersistence プロパティ

メモ : このプロパティは、.NET Framework version 2.0新しく追加されたものです。

デザイン時にサーバー コントロールが、入れ子になったコントロールカスタマイズされた方法保持するかどうかを示す値を取得します

名前空間: System.Web.UI
アセンブリ: System.Web (system.web.dll 内)
構文構文

Public ReadOnly Property
 UsesCustomPersistence As Boolean
Dim instance As PersistChildrenAttribute
Dim value As Boolean

value = instance.UsesCustomPersistence
public bool UsesCustomPersistence { get;
 }
public:
property bool UsesCustomPersistence {
    bool get ();
}
/** @property */
public boolean get_UsesCustomPersistence ()
public function get UsesCustomPersistence
 () : boolean

プロパティ
入れ子になった内容カスタマイズされた方法保持する場合trueそれ以外場合false既定値false です。

解説解説

入れ子になった内容カスタマイズされた方法保持するように設定するには、usesCustomPersistence パラメータ受け取る PersistChildrenAttribute オーバーロード使用します

使用例使用例

UsesCustomPersistence プロパティの値を取得する方法次のコード例示します

このコード例は、PersistChildrenAttribute クラストピック取り上げているコード例一部分です。

<%@ Page Language="VB" %>
<%@ Register TagPrefix="AspSample" Assembly="Samples.AspNet.VB.Controls"
 Namespace="PersistChildrenSampleVB"
 %>


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML
 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<script runat="server">
  
  Protected Sub Page_Load(ByVal
 sender As Object, ByVal
 e As System.EventArgs)

    ' Create two new employees and add them to the custom control.
    Dim e1 As New Employee("Employee
 1", "Title 1", "Alias
 1")
    Dim e2 As New Employee("Employee
 2", "Title 2", "Alias
 2")
    CollectionPropertyControl1.Employees.Add(e1)
    CollectionPropertyControl1.Employees.Add(e2)

    ' Verify attribute values.
    Dim p As PersistChildrenAttribute = _
    Attribute.GetCustomAttribute(GetType(CollectionPropertyControl),
 _
    GetType(PersistChildrenAttribute))

    Dim sb As New StringBuilder()
    sb.Append("The Persist property is " & p.Persist.ToString()
 & "<br>")
    sb.Append("The UseCustomPersistence property is "
 & p.UsesCustomPersistence.ToString() & "<br>")
    sb.Append("The IsDefault method returns " &
 p.IsDefaultAttribute().ToString())
    Message.Text = sb.ToString()

  End Sub
  
</script>


<html  >
<head id="Head1" runat="server">
    <title>PersistChildrenAttribute</title>
</head>
<body>
    <form id="Form1" runat="server">
    <div>
      <asp:Label ID="Message"
                 runat="server"/>
      <AspSample:CollectionPropertyControl id="CollectionPropertyControl1"
 
                                           runat="server">
      </AspSample:CollectionPropertyControl>
    </div>
    </form>
</body>
</html>
<%@ Page Language="C#" %>
<%@ Register TagPrefix="AspSample" Assembly="Samples.AspNet.CS.Controls"
 Namespace="PersistChildrenSamples" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<script runat="server">
  
  protected void Page_Load(object sender, EventArgs
 e)
  {

    // Create two new employees and add them to the custom control.
    Employee e1 = new Employee("Employee 1", "Title
 1", "Alias 1");
    Employee e2 = new Employee("Employee 2", "Title
 2", "Alias 2");
    CollectionPropertyControl1.Employees.Add(e1);
    CollectionPropertyControl1.Employees.Add(e2);

    // Verify attribute values.
    PersistChildrenAttribute p =
      (PersistChildrenAttribute)Attribute.GetCustomAttribute(typeof(CollectionPropertyControl),
 
      typeof(PersistChildrenAttribute));

    StringBuilder sb = new StringBuilder();
    sb.Append("The Persist property is " + p.Persist.ToString() + "<br>");
    sb.Append("The UseCustomPersistence property is " + p.UsesCustomPersistence.ToString()
 + "<br>");
    sb.Append("The IsDefault method returns " + p.IsDefaultAttribute().ToString());
    Message.Text = sb.ToString();
    
  }
</script>

<html  >
<head runat="server">
    <title>PersistChildrenAttribute</title>
</head>
<body>
    <form runat="server">
    <div>
      <asp:Label ID="Message"
                 runat="server"/>
      <AspSample:CollectionPropertyControl id="CollectionPropertyControl1"
 
                                           runat="server">
      </AspSample:CollectionPropertyControl>
    </div>
    </form>
</body>
</html>
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照
関連項目
PersistChildrenAttribute クラス
PersistChildrenAttribute メンバ
System.Web.UI 名前空間
PersistChildrenAttribute
その他の技術情報
コントロール新規作成
カスタム永続性実装



英和和英テキスト翻訳>> Weblio翻訳
英語⇒日本語日本語⇒英語
  

辞書ショートカット

すべての辞書の索引

PersistChildrenAttribute.UsesCustomPersistence プロパティのお隣キーワード
検索ランキング

   

英語⇒日本語
日本語⇒英語
   



PersistChildrenAttribute.UsesCustomPersistence プロパティのページの著作権
Weblio 辞書 情報提供元は 参加元一覧 にて確認できます。

   
日本マイクロソフト株式会社日本マイクロソフト株式会社
© 2024 Microsoft.All rights reserved.

©2024 GRAS Group, Inc.RSS