ParseChildrenAttributeとは? わかりやすく解説

ParseChildrenAttribute クラス

ASP.NET サーバー コントロール開発使用できるメタデータ属性定義しますParseChildrenAttribute クラス使用してページ宣言されているサーバー コントロール タグ内に入れ子になっている内容ページ パーサーどのように処理するかを示します。このクラス継承できません。

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

<AttributeUsageAttribute(AttributeTargets.Class)> _
Public NotInheritable Class
 ParseChildrenAttribute
    Inherits Attribute
Dim instance As ParseChildrenAttribute
[AttributeUsageAttribute(AttributeTargets.Class)] 
public sealed class ParseChildrenAttribute
 : Attribute
[AttributeUsageAttribute(AttributeTargets::Class)] 
public ref class ParseChildrenAttribute sealed
 : public Attribute
/** @attribute AttributeUsageAttribute(AttributeTargets.Class) */ 
public final class ParseChildrenAttribute extends
 Attribute
AttributeUsageAttribute(AttributeTargets.Class) 
public final class ParseChildrenAttribute extends
 Attribute
解説解説
使用例使用例

このセクションには、2 つコード例含まれています。最初コード例では、ParseChildrenAttribute クラスプロパティ設定する方法示します2 番目のコード例では、ASP.NET ページクラス使用する方法示します

次のコード例では、CollectionPropertyControl というカスタム サーバー コントロールParseChildrenAttribute オブジェクト設定する方法示しますParseChildrenAttributeChildrenAsProperties プロパティtrue設定しDefaultProperty プロパティEmployee クラス設定してます。

Imports System
Imports System.Collections
Imports System.Web
Imports System.Web.UI
Imports System.Web.UI.WebControls
Imports System.Security.Permissions

Namespace Samples.AspNet.VB.Controls


    ' The child element class.

    <AspNetHostingPermission(SecurityAction.Demand, _
       Level:=AspNetHostingPermissionLevel.Minimal)> _
    Public NotInheritable Class
 Employee
        Private _name As String
        Private _title As String
        Private _alias As String


        Public Sub New()
            Me.New("", "",
 "")
        End Sub 'New


        Public Sub New(ByVal
 name As String, ByVal
 title As String, ByVal employeeAlias As String)
            Me._name = name
            Me._title = title
            Me._alias = employeeAlias
        End Sub 'New

        Public Property Name() As
 String
            Get
                Return _name
            End Get
            Set(ByVal value As
 String)
                _name = Value
            End Set
        End Property


        Public Property Title() As
 String
            Get
                Return _title
            End Get
            Set(ByVal value As
 String)
                _title = Value
            End Set
        End Property


        Public Property [Alias]() As
 String
            Get
                Return _alias
            End Get
            Set(ByVal value As
 String)
                _alias = Value
            End Set
        End Property
    End Class 'Employee
    ' Use the ParseChildren attribute to set the ChildrenAsProperties
    ' and DefaultProperty properties. Using this constructor, the
    ' control parses all child controls as properties and must define
    ' a public property named Employees, which it declares as
    ' an ArrayList. Nested (child) elements must correspond to
    ' child elements of the Employees property or to other
    ' properties of the control.   
    <ParseChildren(True, "Employees")>
 _
    <AspNetHostingPermission(SecurityAction.Demand, _
       Level:=AspNetHostingPermissionLevel.Minimal)> _
    Public NotInheritable Class
 CollectionPropertyControl
        Inherits Control
        Private _header As String
        Private _employees As New
 ArrayList()


        Public Property Header() As
 String
            Get
                Return _header
            End Get
            Set(ByVal value As
 String)
                _header = Value
            End Set
        End Property




        Public ReadOnly Property
 Employees() As ArrayList
            Get
                Return _employees
            End Get
        End Property

        ' Override the CreateChildControls method to 
        ' add child controls to the Employees property when this
        ' custom control is requested from a page.
        Protected Overrides Sub
 CreateChildControls()
            Dim label As New
 Label()
            label.Text = Header
            label.BackColor = System.Drawing.Color.Beige
            label.ForeColor = System.Drawing.Color.Red
            Controls.Add(label)
            Controls.Add(New LiteralControl("<BR>
 <BR>"))

            Dim table As New
 Table()
            Dim htr As New
 TableRow()

            Dim hcell1 As New
 TableHeaderCell()
            hcell1.Text = "Name"
            htr.Cells.Add(hcell1)

            Dim hcell2 As New
 TableHeaderCell()
            hcell2.Text = "Title"
            htr.Cells.Add(hcell2)

            Dim hcell3 As New
 TableHeaderCell()
            hcell3.Text = "Alias"
            htr.Cells.Add(hcell3)
            table.Rows.Add(htr)

            table.BorderWidth = Unit.Pixel(2)
            table.BackColor = System.Drawing.Color.Beige
            table.ForeColor = System.Drawing.Color.Red
            Dim employee As Employee
            For Each employee In
 Employees
                Dim tr As New
 TableRow()

                Dim cell1 As New
 TableCell()
                cell1.Text = employee.Name
                tr.Cells.Add(cell1)

                Dim cell2 As New
 TableCell()
                cell2.Text = employee.Title
                tr.Cells.Add(cell2)

                Dim cell3 As New
 TableCell()
                cell3.Text = employee.Alias
                tr.Cells.Add(cell3)

                table.Rows.Add(tr)
            Next employee
            Controls.Add(table)
        End Sub 'CreateChildControls
 
    End Class 
End Namespace
using System;
using System.Collections;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Security.Permissions;

namespace Samples.AspNet.CS.Controls
{
   // The child element class.
   [AspNetHostingPermission(SecurityAction.Demand, 
      Level=AspNetHostingPermissionLevel.Minimal)]
   public sealed class Employee
   {
      private String name;
      private String title;
      private String alias;

      public Employee():this (""
,"",""){}
      
      public Employee (String name, String title, String alias)
      {
         this.name = name;
         this.title = title;
         this.alias = alias;
      }
      public String Name
      {
         get
         {
            return name;
         }
         set
         {
            name = value;
         }
      }
      
      public String Title
      {
         get
         {
            return title;
         }
         set
         {
            title = value;
         }
      }
      
      public String Alias
      {
         get
         {
            return alias;
         }
         set
         {
            alias = value;
         }
      }
   }
   // Use the ParseChildren attribute to set the ChildrenAsProperties
   // and DefaultProperty properties. Using this constructor, the
   // control parses all child controls as properties and must define
   // a public property named Employees, which it declares as
   // an ArrayList. Nested (child) elements must correspond to
   // child elements of the Employees property or to other
   // properties of the control.  
   [ParseChildren(true, "Employees")]
   [AspNetHostingPermission(SecurityAction.Demand, 
      Level=AspNetHostingPermissionLevel.Minimal)]
   public sealed class CollectionPropertyControl
 : Control
   {  
      private String header;
      private ArrayList employees = new ArrayList();
      
      public String Header
      {
         get
         {
            return header;
         }
         set
         {
            header = value;
         }
      }


      
      public ArrayList Employees
      {
         get 
         {
            return employees;
         }
      }
      // Override the CreateChildControls method to 
      // add child controls to the Employees property when this
      // custom control is requested from a page.
      protected override void CreateChildControls()
      {
         Label label = new Label();
         label.Text = Header;
         label.BackColor = System.Drawing.Color.Beige;
         label.ForeColor = System.Drawing.Color.Red;
         Controls.Add(label);
         Controls.Add(new LiteralControl("<BR> <BR>"));

         Table table = new Table();
         TableRow htr = new TableRow();

         TableHeaderCell hcell1 = new TableHeaderCell();    
         hcell1.Text = "Name";
         htr.Cells.Add(hcell1);

         TableHeaderCell hcell2 = new TableHeaderCell();
         hcell2.Text = "Title";
         htr.Cells.Add(hcell2);
         
         TableHeaderCell hcell3 = new TableHeaderCell();
         hcell3.Text = "Alias";
         htr.Cells.Add(hcell3);
         table.Rows.Add(htr);

         table.BorderWidth = 2;
         table.BackColor = System.Drawing.Color.Beige;
         table.ForeColor = System.Drawing.Color.Red;
         foreach (Employee employee in Employees)
         {
            TableRow tr = new TableRow();

            TableCell cell1 = new TableCell();
            cell1.Text = employee.Name;
            tr.Cells.Add(cell1);
            
            TableCell cell2 = new TableCell();
            cell2.Text = employee.Title;
            tr.Cells.Add(cell2);
            
            TableCell cell3 = new TableCell();
            cell3.Text = employee.Alias;
            tr.Cells.Add(cell3);
            
            table.Rows.Add(tr);
         }
         Controls.Add(table);
         
      }
   }
}
package ParseChildrenSamples;   
// When compiling this class, name it ParseChildren.dll.
// Create a namespace that defines two classes: one is a custom control
 
// named Employee, which is created for every instance of a child
// element with its name declared in a page associated with this namespace
,
// and the other, named Employees, that contains these child elements.
import System.*;  
import System.Collections.*;  
import System.Web.*;  
import System.Web.UI.*;  
import System.Web.UI.WebControls.*; 
 
// The child element class.
public class Employee
{
    private String name;
    private String title;
    private String alias;

    public Employee()
    {
        this("", "", "");
    } //Employee

    public Employee(String name, String title, String alias)
    {
        this.name = name;
        this.title = title;
        this.alias = alias;
    } //Employee

    /** @property 
     */
    public String get_Name()
    {
        return name;
    } //get_Name

    /** @property 
     */
    public void set_Name(String value)
    {
        name = value;
    } //set_Name

    /** @property 
     */
    public String get_Title()
    {
        return title;
    } //get_Title

    /** @property 
     */
    public void set_Title(String value)
    {
        title = value;
    } //set_Title

    /** @property 
     */
    public String get_Alias()
    {
        return alias;
    } //get_Alias

    /** @property 
     */
    public void set_Alias(String value)
    {
        alias = value;
    } //set_Alias
} //Employee

// Use the ParseChildren attribute to set the ChildrenAsProperties
// and DefaultProperty properties. Using this constructor, the
// control parses all child controls as properties and must define
// a public property named Employees, which it declares as
// an ArrayList. Nested (child) elements must correspond to
// child elements of the Employees property or to other
// properties of the control.   
/** @attribute ParseChildren(true, "Employees")
 */
public class CollectionPropertyControl extends
 Control
{
    private String header;
    private ArrayList employees = new ArrayList();

    /** @property 
     */
    public String get_Header()
    {
        return header;
    } //get_Header

    /** @property 
     */
    public void set_Header(String value)
    {
        header = value;
    } //set_Header

    /** @property 
     */
    public ArrayList get_Employees()
    {
        return employees;
    } //get_Employees

    // Override the CreateChildControls method to 
    // add child controls to the Employees property when this
    // custom control is requested from a page.
    protected void CreateChildControls()
    {
        Label label = new Label();
        label.set_Text(get_Header());
        label.set_BackColor(System.Drawing.Color.get_Beige());
        label.set_ForeColor(System.Drawing.Color.get_Red());
        get_Controls().Add(label);
        get_Controls().Add(new LiteralControl("<BR>
 <BR>"));

        Table table = new Table();
        TableRow htr = new TableRow();

        TableHeaderCell hCell1 = new TableHeaderCell();
        hCell1.set_Text("Name");
        htr.get_Cells().Add(hCell1);

        TableHeaderCell hCell2 = new TableHeaderCell();
        hCell2.set_Text("Title");
        htr.get_Cells().Add(hCell2);

        TableHeaderCell hCell3 = new TableHeaderCell();
        hCell3.set_Text("Alias");
        htr.get_Cells().Add(hCell3);
        table.get_Rows().Add(htr);

        table.set_BorderWidth(new Unit(2));
        table.set_BackColor(System.Drawing.Color.get_Beige());
        table.set_ForeColor(System.Drawing.Color.get_Red());
        Employee employee = null;
        for (int iCtr = 0; iCtr < get_Employees().get_Count();
 iCtr++) {
            employee = (Employee)get_Employees().get_Item(iCtr);
            TableRow tr = new TableRow();

            TableCell cell1 = new TableCell();
            cell1.set_Text(employee.get_Name());
            tr.get_Cells().Add(cell1);

            TableCell cell2 = new TableCell();
            cell2.set_Text(employee.get_Title());
            tr.get_Cells().Add(cell2);

            TableCell cell3 = new TableCell();
            cell3.set_Text(employee.get_Alias());
            tr.get_Cells().Add(cell3);

            table.get_Rows().Add(tr);
        }
        get_Controls().Add(table);
    } //CreateChildControls 
} //CollectionPropertyControl

次のコード例では、CollectionPropertyControl クラスEmployee クラスASP.NET ページ使用する方法示しますEmployee クラスインスタンス宣言追加されます。

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

<!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)
    
    ' Verify attribute values.
    Dim p As ParseChildrenAttribute = _
    Attribute.GetCustomAttribute(GetType(CollectionPropertyControl),
 _
    GetType(ParseChildrenAttribute))

    Dim sb As New StringBuilder()
    sb.Append("The DefaultProperty property is " &
 p.DefaultProperty.ToString() & "<br>")
    sb.Append("The ChildrenAsProperties property is "
 & p.ChildrenAsProperties.ToString() & "<br>")
    sb.Append("The IsDefaultAttribute 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:Employee Name="Employee 1" 
                            Title="Title 1" 
                            Alias="Alias 1"
 />
        <AspSample:Employee Name="Employee 2" 
                            Title="Title 2" 
                            Alias="Alias 2"
 />
      </AspSample:CollectionPropertyControl>
    </div>
    </form>
</body>
</html>
<%@ Page Language="C#" Debug="true" %>
<%@ Register TagPrefix="AspSample" Assembly="Samples.AspNet.CS.Controls"
 Namespace="Samples.AspNet.CS.Controls" %>

<!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)
  {
    
    // Verify attribute values.
    ParseChildrenAttribute p = 
      (ParseChildrenAttribute)Attribute.GetCustomAttribute(typeof(CollectionPropertyControl)
,
      typeof(ParseChildrenAttribute));

    StringBuilder sb = new StringBuilder();
    sb.Append("The DefaultProperty property is " + p.DefaultProperty.ToString()
 + "<br>");
    sb.Append("The ChildrenAsProperties property is " + p.ChildrenAsProperties.ToString()
 + "<br>");
    sb.Append("The IsDefaultAttribute method returns " + p.IsDefaultAttribute().ToString());
    Message.Text = sb.ToString();

  }
</script>

<html  >
<head runat="server">
    <title>ParseChildrenAttribute Example</title>
</head>
<body>
    <form runat="server">
    <div>
      <asp:Label ID="Message"
                 runat="server"/>
      <AspSample:CollectionPropertyControl id="CollectionPropertyControl1"
 
                                           runat="server">
        <AspSample:Employee Name="Employee 1" 
                            Title="Title 1" 
                            Alias="Alias 1" />
        <AspSample:Employee Name="Employee 2" 
                            Title="Title 2" 
                            Alias="Alias 2" />
      </AspSample:CollectionPropertyControl>    
    </div>
    </form>
</body>
</html>
.NET Framework のセキュリティ.NET Frameworkセキュリティ
継承階層継承階層
System.Object
   System.Attribute
    System.Web.UI.ParseChildrenAttribute
スレッド セーフスレッド セーフ
この型の public static (Visual Basic では Shared) メンバはすべて、スレッド セーフです。インスタンス メンバ場合は、スレッド セーフであるとは限りません。
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照

ParseChildrenAttribute コンストラクタ ()


ParseChildrenAttribute コンストラクタ (Boolean)

ChildrenAsProperties プロパティ使用してサーバー コントロール内の要素サーバー コントロールプロパティとして解析するかどうか決定する ParseChildrenAttribute クラス新しインスタンス初期化します。

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

Public Sub New ( _
    childrenAsProperties As Boolean _
)
Dim childrenAsProperties As Boolean

Dim instance As New ParseChildrenAttribute(childrenAsProperties)
public ParseChildrenAttribute (
    bool childrenAsProperties
)
public:
ParseChildrenAttribute (
    bool childrenAsProperties
)
public ParseChildrenAttribute (
    boolean childrenAsProperties
)
public function ParseChildrenAttribute (
    childrenAsProperties : boolean
)

パラメータ

childrenAsProperties

要素サーバー コントロールプロパティとして解析する場合trueそれ以外場合false

解説解説

childrenAsPropertiesfalse場合サーバーコントロール内の要素コントロールとして解析されます。falseParseChildrenAttribute既定値です。

使用例使用例

このセクションには、2 つコード例含まれています。最初コード例では、ParseChildrenAttribute クラスプロパティ設定する方法示します2 番目のコード例では、ASP.NET ページクラス使用する方法示します

次のコード例では、CollectionPropertyControl というカスタム サーバー コントロールParseChildrenAttribute オブジェクト設定する方法示しますCollectionPropertyControl定義するクラス前に ParseChildrenAttribute宣言されParseChildrenAttributeChildrenAsProperties プロパティtrue設定してます。

Imports System
Imports System.Collections
Imports System.Web
Imports System.Web.UI
Imports System.Web.UI.WebControls
Imports System.Security.Permissions

Namespace Samples.AspNet.VB.Controls

    ' Create a class that will be rendered as a child of the control
    ' that has the ParseChildren attribute applied to it.
    <AspNetHostingPermission(SecurityAction.Demand, _
      Level:=AspNetHostingPermissionLevel.Minimal)> _
    Public NotInheritable Class
 Employee
        Private _name As String
        Private _title As String
        Private _alias As String


        Public Sub New()
            Me.New("", "",
 "")
        End Sub 'New


        Public Sub New(ByVal
 name As String, ByVal
 title As String, ByVal employeeAlias As String)
            Me._name = name
            Me._title = title
            Me._alias = employeeAlias
        End Sub 'New

        Public Property Name() As
 String
            Get
                Return _name
            End Get
            Set(ByVal value As
 String)
                _name = Value
            End Set
        End Property


        Public Property Title() As
 String
            Get
                Return _title
            End Get
            Set(ByVal value As
 String)
                _title = Value
            End Set
        End Property


        Public Property [Alias]() As
 String
            Get
                Return _alias
            End Get
            Set(ByVal value As
 String)
                _alias = Value
            End Set
        End Property
    End Class 'Employee

    ' Use this Boolean version of the ParseChildrenAttribute constructor
    ' to set the ChildrenAsProperties property to true. Any properties
 of the
    ' the CollectionPropertyControl custom control will be used as parsable
    ' children.
    <ParseChildren(True)> _
    <AspNetHostingPermission(SecurityAction.Demand, _
       Level:=AspNetHostingPermissionLevel.Minimal)> _
    Public NotInheritable Class
 CollectionPropertyControl
        Inherits Control
        Private _header As String
        Private _employees As New
 ArrayList()


        Public Property Header() As
 String
            Get
                Return _header
            End Get
            Set(ByVal value As
 String)
                _header = Value
            End Set
        End Property




        Public ReadOnly Property
 Employees() As ArrayList
            Get
                Return _employees
            End Get
        End Property

        ' Override the CreateChildControls method to 
        ' add child controls to the Employees property when this
        ' custom control is requested from a page.
        Protected Overrides Sub
 CreateChildControls()
            Dim label As New
 Label()
            label.Text = Header
            label.BackColor = System.Drawing.Color.Beige
            label.ForeColor = System.Drawing.Color.Red
            Controls.Add(label)
            Controls.Add(New LiteralControl("<BR>
 <BR>"))

            Dim table As New
 Table()
            Dim htr As New
 TableRow()

            Dim hcell1 As New
 TableHeaderCell()
            hcell1.Text = "Name"
            htr.Cells.Add(hcell1)

            Dim hcell2 As New
 TableHeaderCell()
            hcell2.Text = "Title"
            htr.Cells.Add(hcell2)

            Dim hcell3 As New
 TableHeaderCell()
            hcell3.Text = "Alias"
            htr.Cells.Add(hcell3)
            table.Rows.Add(htr)

            table.BorderWidth = Unit.Pixel(2)
            table.BackColor = System.Drawing.Color.Beige
            table.ForeColor = System.Drawing.Color.Red
            Dim employee As Employee
            For Each employee In
 Employees
                Dim tr As New
 TableRow()

                Dim cell1 As New
 TableCell()
                cell1.Text = employee.Name
                tr.Cells.Add(cell1)

                Dim cell2 As New
 TableCell()
                cell2.Text = employee.Title
                tr.Cells.Add(cell2)

                Dim cell3 As New
 TableCell()
                cell3.Text = employee.Alias
                tr.Cells.Add(cell3)

                table.Rows.Add(tr)
            Next employee
            Controls.Add(table)
        End Sub 'CreateChildControls
 
    End Class 'CollectionPropertyControl
End Namespace ' ParseChildrenSampleVB_2
using System;
using System.Collections;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Security.Permissions;

namespace Samples.AspNet.CS.Controls
{
   // Create a class that will be rendered as a child of the control
   // that has the ParseChildren attribute applied to it.
   [AspNetHostingPermission(SecurityAction.Demand, 
      Level=AspNetHostingPermissionLevel.Minimal)]
   public sealed class Employee
   {
      private String name;
      private String title;
      private String alias;

      public Employee():this (""
,"",""){}
      
      public Employee (String name, String title, String alias)
      {
         this.name = name;
         this.title = title;
         this.alias = alias;
      }
      public String Name
      {
         get
         {
            return name;
         }
         set
         {
            name = value;
         }
      }
      
      public String Title
      {
         get
         {
            return title;
         }
         set
         {
            title = value;
         }
      }
      
      public String Alias
      {
         get
         {
            return alias;
         }
         set
         {
            alias = value;
         }
      }
   }
   // Use this Boolean version of the ParseChildrenAttribute constructor
   // to set the ChildrenAsProperties property to true. Any properties
 of the
   // the CollectionPropertyControl custom control will be used as parsable
   // children.
   [ParseChildren(true)]
   [AspNetHostingPermission(SecurityAction.Demand, 
      Level=AspNetHostingPermissionLevel.Minimal)]
   public sealed class CollectionPropertyControl
 : Control
   {  
      private String header;
      private ArrayList employees = new ArrayList();
      
      public String Header
      {
         get
         {
            return header;
         }
         set
         {
            header = value;
         }
      }


      
      public ArrayList Employees
      {
         get 
         {
            return employees;
         }
      }

      // Override the CreateChildControls method to 
      // add child controls to the Employees property when this
      // custom control is requested from a page.
      protected override void CreateChildControls()
      {
         Label label = new Label();
         label.Text = Header;
         label.BackColor = System.Drawing.Color.Beige;
         label.ForeColor = System.Drawing.Color.Red;
         Controls.Add(label);
         Controls.Add(new LiteralControl("<BR> <BR>"));

         Table table = new Table();
         TableRow htr = new TableRow();

         TableHeaderCell hcell1 = new TableHeaderCell();    
         hcell1.Text = "Name";
         htr.Cells.Add(hcell1);

         TableHeaderCell hcell2 = new TableHeaderCell();
         hcell2.Text = "Title";
         htr.Cells.Add(hcell2);
         
         TableHeaderCell hcell3 = new TableHeaderCell();
         hcell3.Text = "Alias";
         htr.Cells.Add(hcell3);
         table.Rows.Add(htr);

         table.BorderWidth = 2;
         table.BackColor = System.Drawing.Color.Beige;
         table.ForeColor = System.Drawing.Color.Red;
         foreach (Employee employee in Employees)
         {
            TableRow tr = new TableRow();

            TableCell cell1 = new TableCell();
            cell1.Text = employee.Name;
            tr.Cells.Add(cell1);
            
            TableCell cell2 = new TableCell();
            cell2.Text = employee.Title;
            tr.Cells.Add(cell2);
            
            TableCell cell3 = new TableCell();
            cell3.Text = employee.Alias;
            tr.Cells.Add(cell3);
            
            table.Rows.Add(tr);
         }
         Controls.Add(table);
         
      }
   }
}
package ParseChildrenSamples_2;
// Create a namespace that defines two classes, one a custom control,
 Employee,
// which is created for every instance of a child element with its name
// declared in a page associated with this namespace, the other, Employees
,
// which contains these child elements.
import System.*;
import System.Collections.*;
import System.Web.*;
import System.Web.UI.*;
import System.Web.UI.WebControls.*;

// Create a class that will be rendered as a child of the control
// that has the ParseChildren attribute applied to it.
public class Employee
{
    private String name;
    private String title;
    private String alias;

    public Employee()
    {
        this("", "", "");
    } //Employee

    public Employee(String name, String title, String alias)
    {
        this.name = name;
        this.title = title;
        this.alias = alias;
    } //Employee

    /** @property 
     */
    public String get_Name()
    {
        return name;
    } //get_Name

    /** @property 
     */
    public void set_Name(String value)
    {
        name = value;
    } //set_Name

    /** @property 
     */
    public String get_Title()
    {
        return title;
    } //get_Title

    /** @property 
     */
    public void set_Title(String value)
    {
        title = value;
    } //set_Title

    /** @property *
     */
    public String get_Alias()
    {
        return alias;
    } //get_Alias

    /** @property 
     */
    public void set_Alias(String value)
    {
        alias = value;
    } //set_Alias
} //Employee

// Use this Boolean version of the ParseChildrenAttribute constructor
// to set the ChildrenAsProperties property to true. Any properties
 of the
// the CollectionPropertyControl custom control will be used as parsable
// children.
/** @attribute ParseChildren(true)
 */
public class CollectionPropertyControl extends
 Control
{
    private String header;
    private ArrayList employees = new ArrayList();

    /** @property 
     */
    public String get_Header()
    {
        return header;
    } //get_Header

    /** @property 
     */
    public void set_Header(String value)
    {
        header = value;
    } //set_Header

    /** @property 
     */
    public ArrayList get_Employees()
    {
        return employees;
    } //get_Employees

    // Override the CreateChildControls method to 
    // add child controls to the Employees property when this
    // custom control is requested from a page.
    protected void CreateChildControls()
    {
        Label label = new Label();
        label.set_Text(get_Header());
        label.set_BackColor(System.Drawing.Color.get_Beige());
        label.set_ForeColor(System.Drawing.Color.get_Red());
        get_Controls().Add(label);
        get_Controls().Add(new LiteralControl("<BR>
 <BR>"));

        Table table = new Table();
        TableRow htr = new TableRow();

        TableHeaderCell hCell1 = new TableHeaderCell();
        hCell1.set_Text("Name");
        htr.get_Cells().Add(hCell1);

        TableHeaderCell hCell2 = new TableHeaderCell();
        hCell2.set_Text("Title");
        htr.get_Cells().Add(hCell2);

        TableHeaderCell hCell3 = new TableHeaderCell();
        hCell3.set_Text("Alias");
        htr.get_Cells().Add(hCell3);
        table.get_Rows().Add(htr);

        table.set_BorderWidth(new Unit(2));
        table.set_BackColor(System.Drawing.Color.get_Beige());
        table.set_ForeColor(System.Drawing.Color.get_Red());
        Employee employee = null;
        for (int iCtr = 0; iCtr < get_Employees().get_Count();
 iCtr++) {
            employee = (Employee)get_Employees().get_Item(iCtr);
            TableRow tr = new TableRow();

            TableCell cell1 = new TableCell();
            cell1.set_Text(employee.get_Name());
            tr.get_Cells().Add(cell1);

            TableCell cell2 = new TableCell();
            cell2.set_Text(employee.get_Title());
            tr.get_Cells().Add(cell2);

            TableCell cell3 = new TableCell();
            cell3.set_Text(employee.get_Alias());
            tr.get_Cells().Add(cell3);

            table.get_Rows().Add(tr);
        }
        get_Controls().Add(table);
    } //CreateChildControls 
} //CollectionPropertyControl

次のコード例では、CollectionPropertyControl クラスEmployee クラスASP.NET ページ使用する方法示しますEmployee クラス1 つインスタンス宣言追加され、もう 1 つインスタンスプログラム追加されます。

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

<!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 a new employee object and add it to custom control.
    Dim e1 As New Employee("Employee
 2", "Title 2", "Alias
 2")
    CollectionPropertyControl1.Employees.Add(e1)

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

    Dim sb As New StringBuilder()
    sb.Append("The ChildControlType property is "
 & p.ChildControlType.ToString() & "<br>")
    sb.Append("The ChildrenAsProperties property is "
 & p.ChildrenAsProperties.ToString() & "<br>")
    sb.Append("The IsDefaultAttribute 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">
      <Employees>
        <AspSample:Employee Name="Employee 1" 
                            Title="Title 1" 
                            Alias="Alias 1"
 />
      </Employees>
      </AspSample:CollectionPropertyControl>
    </div>
    </form>
</body>
</html>
<%@ Page Language="C#" %>
<%@ Register TagPrefix="AspSample" Assembly="Samples.AspNet.CS.Controls"
 Namespace="Samples.AspNet.CS.Controls" %>

<!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 a new employee object and add it to the custom control.
    Employee e1 = new Employee("Employee 2", "Title
 2", "Alias 2");
    CollectionPropertyControl1.Employees.Add(e1);

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

    StringBuilder sb = new StringBuilder();
    sb.Append("The ChildControlType property is " + p.ChildControlType.ToString()
 + "<br>");
    sb.Append("The ChildrenAsProperties property is " + p.ChildrenAsProperties.ToString()
 + "<br>");
    sb.Append("The IsDefaultAttribute method returns " + p.IsDefaultAttribute().ToString());
    Message.Text = sb.ToString();

  }
</script>

<html  >
<head runat="server">
    <title>ParseChildrenAttribute Example</title>
</head>
<body>
    <form runat="server">
    <div>
      <asp:Label ID="Message"
                 runat="server"/>
      <AspSample:CollectionPropertyControl id="CollectionPropertyControl1"
 
                                           runat="server">
      <Employees>
        <AspSample:Employee Name="Employee 1" 
                            Title="Title 1" 
                            Alias="Alias 1" />
      </Employees>
      </AspSample:CollectionPropertyControl>    
    </div>
    </form>
</body>
</html>
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照
関連項目
ParseChildrenAttribute クラス
ParseChildrenAttribute メンバ
System.Web.UI 名前空間
ChildrenAsProperties

ParseChildrenAttribute コンストラクタ (Type)

メモ : このコンストラクタは、.NET Framework version 2.0新しく追加されたものです。

ChildControlType プロパティ使用してコントロールとして解析するサーバー コントロール内の要素決定する ParseChildrenAttribute クラス新しインスタンス初期化します。

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

Public Sub New ( _
    childControlType As Type _
)
Dim childControlType As Type

Dim instance As New ParseChildrenAttribute(childControlType)
public ParseChildrenAttribute (
    Type childControlType
)
public:
ParseChildrenAttribute (
    Type^ childControlType
)
public ParseChildrenAttribute (
    Type childControlType
)
public function ParseChildrenAttribute (
    childControlType : Type
)

パラメータ

childControlType

プロパティとして解析するコントロールタイプ

例外例外
例外種類条件

ArgumentNullException

childControlTypenull 参照 (Visual Basic では Nothing) です。

プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照
関連項目
ParseChildrenAttribute クラス
ParseChildrenAttribute メンバ
System.Web.UI 名前空間
ParseChildrenAttribute

ParseChildrenAttribute コンストラクタ (Boolean, String)

childrenAsProperties パラメータdefaultProperty パラメータ使用して、ParseChildrenAttribute クラス新しインスタンス初期化します。

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

Public Sub New ( _
    childrenAsProperties As Boolean, _
    defaultProperty As String _
)
Dim childrenAsProperties As Boolean
Dim defaultProperty As String

Dim instance As New ParseChildrenAttribute(childrenAsProperties,
 defaultProperty)
public ParseChildrenAttribute (
    bool childrenAsProperties,
    string defaultProperty
)
public:
ParseChildrenAttribute (
    bool childrenAsProperties, 
    String^ defaultProperty
)
public ParseChildrenAttribute (
    boolean childrenAsProperties, 
    String defaultProperty
)
public function ParseChildrenAttribute (
    childrenAsProperties : boolean, 
    defaultProperty : String
)

パラメータ

childrenAsProperties

要素サーバー コントロールプロパティとして解析する場合trueそれ以外場合false

defaultProperty

既定入れ子内容解析した結果格納されるサーバー コントロールコレクション プロパティ定義する文字列

解説解説

childrenAsPropertiesfalse場合要素コントロールとして解析されます。

使用例使用例

このセクションには、2 つコード例含まれています。最初コード例では、ParseChildrenAttribute クラスプロパティ設定する方法示します2 番目のコード例では、ASP.NET ページクラス使用する方法示します

次のコード例では、CollectionPropertyControl というカスタム サーバー コントロールParseChildrenAttribute オブジェクト設定する方法示しますParseChildrenAttribute は ChildrenAsProperties プロパティtrue設定し、DefaultProperty プロパティEmployee クラス設定してます。

' Use the ParseChildren attribute to set the ChildrenAsProperties
' and DefaultProperty properties. Using this constructor, the
' control parses all child controls as properties and must define
' a public property named Employees, which it declares as
' an ArrayList. Nested (child) elements must correspond to
' child elements of the Employees property or to other
' properties of the control.   
<ParseChildren(True, "Employees")>
 _
<AspNetHostingPermission(SecurityAction.Demand, _
   Level:=AspNetHostingPermissionLevel.Minimal)> _
Public NotInheritable Class
 CollectionPropertyControl
    Inherits Control
    Private _header As String
    Private _employees As New
 ArrayList()


    Public Property Header() As
 String
        Get
            Return _header
        End Get
        Set(ByVal value As
 String)
            _header = Value
        End Set
    End Property




    Public ReadOnly Property
 Employees() As ArrayList
        Get
            Return _employees
        End Get
    End Property

    ' Override the CreateChildControls method to 
    ' add child controls to the Employees property when this
    ' custom control is requested from a page.
    Protected Overrides Sub
 CreateChildControls()
        Dim label As New
 Label()
        label.Text = Header
        label.BackColor = System.Drawing.Color.Beige
        label.ForeColor = System.Drawing.Color.Red
        Controls.Add(label)
        Controls.Add(New LiteralControl("<BR>
 <BR>"))

        Dim table As New
 Table()
        Dim htr As New TableRow()

        Dim hcell1 As New
 TableHeaderCell()
        hcell1.Text = "Name"
        htr.Cells.Add(hcell1)

        Dim hcell2 As New
 TableHeaderCell()
        hcell2.Text = "Title"
        htr.Cells.Add(hcell2)

        Dim hcell3 As New
 TableHeaderCell()
        hcell3.Text = "Alias"
        htr.Cells.Add(hcell3)
        table.Rows.Add(htr)

        table.BorderWidth = Unit.Pixel(2)
        table.BackColor = System.Drawing.Color.Beige
        table.ForeColor = System.Drawing.Color.Red
        Dim employee As Employee
        For Each employee In
 Employees
            Dim tr As New
 TableRow()

            Dim cell1 As New
 TableCell()
            cell1.Text = employee.Name
            tr.Cells.Add(cell1)

            Dim cell2 As New
 TableCell()
            cell2.Text = employee.Title
            tr.Cells.Add(cell2)

            Dim cell3 As New
 TableCell()
            cell3.Text = employee.Alias
            tr.Cells.Add(cell3)

            table.Rows.Add(tr)
        Next employee
        Controls.Add(table)
    End Sub 'CreateChildControls
 
End Class 
// Use the ParseChildren attribute to set the ChildrenAsProperties
// and DefaultProperty properties. Using this constructor, the
// control parses all child controls as properties and must define
// a public property named Employees, which it declares as
// an ArrayList. Nested (child) elements must correspond to
// child elements of the Employees property or to other
// properties of the control.  
[ParseChildren(true, "Employees")]
[AspNetHostingPermission(SecurityAction.Demand, 
   Level=AspNetHostingPermissionLevel.Minimal)]
public sealed class CollectionPropertyControl
 : Control
{  
   private String header;
   private ArrayList employees = new ArrayList();
   
   public String Header
   {
      get
      {
         return header;
      }
      set
      {
         header = value;
      }
   }


   
   public ArrayList Employees
   {
      get 
      {
         return employees;
      }
   }
   // Override the CreateChildControls method to 
   // add child controls to the Employees property when this
   // custom control is requested from a page.
   protected override void CreateChildControls()
   {
      Label label = new Label();
      label.Text = Header;
      label.BackColor = System.Drawing.Color.Beige;
      label.ForeColor = System.Drawing.Color.Red;
      Controls.Add(label);
      Controls.Add(new LiteralControl("<BR> <BR>"));

      Table table = new Table();
      TableRow htr = new TableRow();

      TableHeaderCell hcell1 = new TableHeaderCell();    
      hcell1.Text = "Name";
      htr.Cells.Add(hcell1);

      TableHeaderCell hcell2 = new TableHeaderCell();
      hcell2.Text = "Title";
      htr.Cells.Add(hcell2);
      
      TableHeaderCell hcell3 = new TableHeaderCell();
      hcell3.Text = "Alias";
      htr.Cells.Add(hcell3);
      table.Rows.Add(htr);

      table.BorderWidth = 2;
      table.BackColor = System.Drawing.Color.Beige;
      table.ForeColor = System.Drawing.Color.Red;
      foreach (Employee employee in Employees)
      {
         TableRow tr = new TableRow();

         TableCell cell1 = new TableCell();
         cell1.Text = employee.Name;
         tr.Cells.Add(cell1);
         
         TableCell cell2 = new TableCell();
         cell2.Text = employee.Title;
         tr.Cells.Add(cell2);
         
         TableCell cell3 = new TableCell();
         cell3.Text = employee.Alias;
         tr.Cells.Add(cell3);
         
         table.Rows.Add(tr);
      }
      Controls.Add(table);
      
   }
}
// Use the ParseChildren attribute to set the ChildrenAsProperties
// and DefaultProperty properties. Using this constructor, the
// control parses all child controls as properties and must define
// a public property named Employees, which it declares as
// an ArrayList. Nested (child) elements must correspond to
// child elements of the Employees property or to other
// properties of the control.   
/** @attribute ParseChildren(true, "Employees")
 */
public class CollectionPropertyControl extends
 Control
{
    private String header;
    private ArrayList employees = new ArrayList();

    /** @property 
     */
    public String get_Header()
    {
        return header;
    } //get_Header

    /** @property 
     */
    public void set_Header(String value)
    {
        header = value;
    } //set_Header

    /** @property 
     */
    public ArrayList get_Employees()
    {
        return employees;
    } //get_Employees

    // Override the CreateChildControls method to 
    // add child controls to the Employees property when this
    // custom control is requested from a page.
    protected void CreateChildControls()
    {
        Label label = new Label();
        label.set_Text(get_Header());
        label.set_BackColor(System.Drawing.Color.get_Beige());
        label.set_ForeColor(System.Drawing.Color.get_Red());
        get_Controls().Add(label);
        get_Controls().Add(new LiteralControl("<BR>
 <BR>"));

        Table table = new Table();
        TableRow htr = new TableRow();

        TableHeaderCell hCell1 = new TableHeaderCell();
        hCell1.set_Text("Name");
        htr.get_Cells().Add(hCell1);

        TableHeaderCell hCell2 = new TableHeaderCell();
        hCell2.set_Text("Title");
        htr.get_Cells().Add(hCell2);

        TableHeaderCell hCell3 = new TableHeaderCell();
        hCell3.set_Text("Alias");
        htr.get_Cells().Add(hCell3);
        table.get_Rows().Add(htr);

        table.set_BorderWidth(new Unit(2));
        table.set_BackColor(System.Drawing.Color.get_Beige());
        table.set_ForeColor(System.Drawing.Color.get_Red());
        Employee employee = null;
        for (int iCtr = 0; iCtr < get_Employees().get_Count();
 iCtr++) {
            employee = (Employee)get_Employees().get_Item(iCtr);
            TableRow tr = new TableRow();

            TableCell cell1 = new TableCell();
            cell1.set_Text(employee.get_Name());
            tr.get_Cells().Add(cell1);

            TableCell cell2 = new TableCell();
            cell2.set_Text(employee.get_Title());
            tr.get_Cells().Add(cell2);

            TableCell cell3 = new TableCell();
            cell3.set_Text(employee.get_Alias());
            tr.get_Cells().Add(cell3);

            table.get_Rows().Add(tr);
        }
        get_Controls().Add(table);
    } //CreateChildControls 
} //CollectionPropertyControl

次のコード例では、CollectionPropertyControl クラスEmployee クラスASP.NET ページ使用する方法示します

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

<!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)
    
    ' Verify attribute values.
    Dim p As ParseChildrenAttribute = _
    Attribute.GetCustomAttribute(GetType(CollectionPropertyControl),
 _
    GetType(ParseChildrenAttribute))

    Dim sb As New StringBuilder()
    sb.Append("The DefaultProperty property is " &
 p.DefaultProperty.ToString() & "<br>")
    sb.Append("The ChildrenAsProperties property is "
 & p.ChildrenAsProperties.ToString() & "<br>")
    sb.Append("The IsDefaultAttribute 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:Employee Name="Employee 1" 
                            Title="Title 1" 
                            Alias="Alias 1"
 />
        <AspSample:Employee Name="Employee 2" 
                            Title="Title 2" 
                            Alias="Alias 2"
 />
      </AspSample:CollectionPropertyControl>
    </div>
    </form>
</body>
</html>
<%@ Page Language="C#" Debug="true" %>
<%@ Register TagPrefix="AspSample" Assembly="Samples.AspNet.CS.Controls"
 Namespace="Samples.AspNet.CS.Controls" %>

<!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)
  {
    
    // Verify attribute values.
    ParseChildrenAttribute p = 
      (ParseChildrenAttribute)Attribute.GetCustomAttribute(typeof(CollectionPropertyControl)
,
      typeof(ParseChildrenAttribute));

    StringBuilder sb = new StringBuilder();
    sb.Append("The DefaultProperty property is " + p.DefaultProperty.ToString()
 + "<br>");
    sb.Append("The ChildrenAsProperties property is " + p.ChildrenAsProperties.ToString()
 + "<br>");
    sb.Append("The IsDefaultAttribute method returns " + p.IsDefaultAttribute().ToString());
    Message.Text = sb.ToString();

  }
</script>

<html  >
<head runat="server">
    <title>ParseChildrenAttribute Example</title>
</head>
<body>
    <form runat="server">
    <div>
      <asp:Label ID="Message"
                 runat="server"/>
      <AspSample:CollectionPropertyControl id="CollectionPropertyControl1"
 
                                           runat="server">
        <AspSample:Employee Name="Employee 1" 
                            Title="Title 1" 
                            Alias="Alias 1" />
        <AspSample:Employee Name="Employee 2" 
                            Title="Title 2" 
                            Alias="Alias 2" />
      </AspSample:CollectionPropertyControl>    
    </div>
    </form>
</body>
</html>
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照
関連項目
ParseChildrenAttribute クラス
ParseChildrenAttribute メンバ
System.Web.UI 名前空間
ChildrenAsProperties
Default

ParseChildrenAttribute コンストラクタ

ParseChildrenAttribute クラス新しインスタンス初期化します。
オーバーロードの一覧オーバーロードの一覧

参照参照

関連項目

ParseChildrenAttribute クラス
ParseChildrenAttribute メンバ
System.Web.UI 名前空間
ChildrenAsProperties

ParseChildrenAttribute フィールド


パブリック フィールドパブリック フィールド

  名前 説明
パブリック フィールド Default ParseChildrenAttribute クラス既定値定義します。このフィールド読み取り専用です。
パブリック フィールド ParseAsChildren サーバー コントロール内に入れ子になった内容をコントールとして解析することを示します
パブリック フィールド ParseAsProperties サーバー コントロール内に入れ子になった内容をそのコントールのプロパティとして解析することを示します
参照参照

関連項目

ParseChildrenAttribute クラス
System.Web.UI 名前空間
Attribute
PersistChildrenAttribute

その他の技術情報

属性使用したメタデータ拡張

ParseChildrenAttribute プロパティ


パブリック プロパティパブリック プロパティ

参照参照

関連項目

ParseChildrenAttribute クラス
System.Web.UI 名前空間
Attribute
PersistChildrenAttribute

その他の技術情報

属性使用したメタデータ拡張

ParseChildrenAttribute メソッド


パブリック メソッドパブリック メソッド

( プロテクト メソッド参照)
  名前 説明
パブリック メソッド Equals オーバーロードされますオーバーライドされます2 つオブジェクト等しかどうか判断します
パブリック メソッド GetCustomAttribute  オーバーロードされますアセンブリモジュール、型のメンバ、またはメソッド パラメータ適用され指定した型のカスタム属性取得します。 ( Attribute から継承されます。)
パブリック メソッド GetCustomAttributes  オーバーロードされますアセンブリモジュール、型のメンバ、またはメソッド パラメータ適用されカスタム属性配列取得します。 ( Attribute から継承されます。)
パブリック メソッド GetHashCode オーバーライドされます。 ParseChildrenAttribute オブジェクトハッシュ関数として機能します
パブリック メソッド GetType  現在のインスタンスType取得します。 ( Object から継承されます。)
パブリック メソッド IsDefaultAttribute オーバーライドされますParseChildrenAttribute クラス現在のインスタンスの値を派生クラス既定値にするかどうかを示す値を返します
パブリック メソッド IsDefined  オーバーロードされます指定した型のカスタム属性が、アセンブリモジュール、型のメンバ、またはメソッド パラメータ適用されているかどうか判断します。 ( Attribute から継承されます。)
パブリック メソッド Match  派生クラス内でオーバーライドされたときに、指定したオブジェクトとこのインスタンス等しかどうかを示す値を返します。 ( Attribute から継承されます。)
パブリック メソッド ReferenceEquals  指定した複数Object インスタンス同一かどうか判断します。 ( Object から継承されます。)
パブリック メソッド ToString  現在の Object を表す String返します。 ( Object から継承されます。)
プロテクト メソッドプロテクト メソッド
参照参照

関連項目

ParseChildrenAttribute クラス
System.Web.UI 名前空間
Attribute
PersistChildrenAttribute

その他の技術情報

属性使用したメタデータ拡張

ParseChildrenAttribute メンバ

ASP.NET サーバー コントロール開発使用できるメタデータ属性定義します。ParseChildrenAttribute クラス使用してページ宣言されているサーバー コントロール タグ内に入れ子になっている内容ページ パーサーどのように処理するかを示します。このクラス継承できません。

ParseChildrenAttribute データ型公開されるメンバを以下の表に示します


パブリック コンストラクタパブリック コンストラクタ
  名前 説明
パブリック メソッド ParseChildrenAttribute オーバーロードされますParseChildrenAttribute クラス新しインスタンス初期化します。
パブリック フィールドパブリック フィールド
  名前 説明
パブリック フィールド Default ParseChildrenAttribute クラス既定値定義します。このフィールド読み取り専用です。
パブリック フィールド ParseAsChildren サーバー コントロール内に入れ子になった内容をコントールとして解析することを示します
パブリック フィールド ParseAsProperties サーバー コントロール内に入れ子になった内容をそのコントールのプロパティとして解析することを示します
パブリック プロパティパブリック プロパティ
パブリック メソッドパブリック メソッド
( プロテクト メソッド参照)
  名前 説明
パブリック メソッド Equals オーバーロードされますオーバーライドされます2 つオブジェクト等しかどうか判断します
パブリック メソッド GetCustomAttribute  オーバーロードされますアセンブリモジュール、型のメンバ、またはメソッド パラメータ適用され指定した型のカスタム属性取得します。 (Attribute から継承されます。)
パブリック メソッド GetCustomAttributes  オーバーロードされますアセンブリモジュール、型のメンバ、またはメソッド パラメータ適用されカスタム属性配列取得します。 (Attribute から継承されます。)
パブリック メソッド GetHashCode オーバーライドされますParseChildrenAttribute オブジェクトハッシュ関数として機能します
パブリック メソッド GetType  現在のインスタンスType取得します。 (Object から継承されます。)
パブリック メソッド IsDefaultAttribute オーバーライドされますParseChildrenAttribute クラス現在のインスタンスの値を派生クラス既定値にするかどうかを示す値を返します
パブリック メソッド IsDefined  オーバーロードされます指定した型のカスタム属性が、アセンブリモジュール、型のメンバ、またはメソッド パラメータ適用されているかどうか判断します。 (Attribute から継承されます。)
パブリック メソッド Match  派生クラス内でオーバーライドされたときに、指定したオブジェクトとこのインスタンス等しかどうかを示す値を返します。 (Attribute から継承されます。)
パブリック メソッド ReferenceEquals  指定した複数Object インスタンス同一かどうか判断します。 (Object から継承されます。)
パブリック メソッド ToString  現在の Object を表す String返します。 (Object から継承されます。)
プロテクト メソッドプロテクト メソッド
参照参照

関連項目

ParseChildrenAttribute クラス
System.Web.UI 名前空間
Attribute
PersistChildrenAttribute

その他の技術情報

属性使用したメタデータ拡張



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

辞書ショートカット

すべての辞書の索引

「ParseChildrenAttribute」の関連用語

ParseChildrenAttributeのお隣キーワード
検索ランキング

   

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



ParseChildrenAttributeのページの著作権
Weblio 辞書 情報提供元は 参加元一覧 にて確認できます。

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

©2025 GRAS Group, Inc.RSS