WizardStepCollection クラス

定義

ウィザードとして機能するコントロールの WizardStepBase 派生オブジェクトのコレクションを表します。 このクラスは継承できません。

public ref class WizardStepCollection sealed : System::Collections::IList
public sealed class WizardStepCollection : System.Collections.IList
type WizardStepCollection = class
    interface IList
    interface ICollection
    interface IEnumerable
Public NotInheritable Class WizardStepCollection
Implements IList
継承
WizardStepCollection
実装

次の例では、宣言構文を使用してコレクションを設定する WizardStepCollection 方法を示します。

<%@ Page Language="C#" %>

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

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    <title>ASP.NET Example</title>
</head>
<body>
    <form id="form1" runat="server">
      <asp:Wizard id="Wizard1" 
        runat="server" >
        <WizardSteps>
          <asp:WizardStep id="Step1" 
            runat="server" 
            title="Step 1">
          </asp:WizardStep>
          <asp:WizardStep id="Step2" 
            runat="server" 
            title="Step 2">
          </asp:WizardStep>
          <asp:WizardStep id="Step3" 
            runat="server" 
            title="Step 3">
          </asp:WizardStep>
          <asp:WizardStep id="Step4" 
            runat="server" 
            title="Step 4">
          </asp:WizardStep>
          <asp:WizardStep id="Step5" 
            runat="server" 
            title="Step 5">
          </asp:WizardStep>
          <asp:WizardStep id="Step6" 
            runat="server" 
            title="Step 6">
          </asp:WizardStep>
        </WizardSteps>
        <HeaderTemplate>
          <b>WizardStepCollection Example</b>
        </HeaderTemplate>
      </asp:Wizard>
    </form>
  </body>
</html>
<%@ Page Language="VB" %>

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

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    <title>ASP.NET Example</title>
</head>
<body>
    <form id="form1" runat="server">
      <asp:Wizard id="Wizard1" 
        runat="server" >
        <WizardSteps>
          <asp:WizardStep id="Step1" 
            runat="server" 
            title="Step 1">
          </asp:WizardStep>
          <asp:WizardStep id="Step2" 
            runat="server" 
            title="Step 2">
          </asp:WizardStep>
          <asp:WizardStep id="Step3" 
            runat="server" 
            title="Step 3">
          </asp:WizardStep>
          <asp:WizardStep id="Step4" 
            runat="server" 
            title="Step 4">
          </asp:WizardStep>
          <asp:WizardStep id="Step5" 
            runat="server" 
            title="Step 5">
          </asp:WizardStep>
          <asp:WizardStep id="Step6" 
            runat="server" 
            title="Step 6">
          </asp:WizardStep>
        </WizardSteps>
        <HeaderTemplate>
          <b>WizardStepCollection Example</b>
        </HeaderTemplate>
      </asp:Wizard>
    </form>
  </body>
</html>

次の例では、プログラムによってコレクションを設定する方法を WizardStepCollection 示します。

<%@ Page Language="C#" CodeFile="WizardStepCollection.cs" Inherits="WizardStepCollectioncs_aspx" %>

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

<html xmlns="http://www.w3.org/1999/xhtml" >
  <head runat="server">
    <title>WizardStepCollection Example</title>
</head>
<body>
    <form id="Form1" runat="server">
      <h3>WizardStepCollection Example</h3>
      <asp:PlaceHolder id="PlaceHolder1" 
        runat="server" />
    </form>
  </body>
</html>
<%@ Page Language="VB" CodeFile="WizardStepCollection.vb" Inherits="WizardStepCollectionvb_aspx" %>

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

<html xmlns="http://www.w3.org/1999/xhtml" >
  <head runat="server">
    <title>WizardStepCollection Example</title>
</head>
<body>
    <form id="Form1" runat="server">
      <h3>WizardStepCollection Example</h3>
      <asp:PlaceHolder id="PlaceHolder1" 
        runat="server" />
    </form>
  </body>
</html>

前の例の Web ページの分離コード ファイルを次に示します。

using System;
using System.Data;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;

public partial class WizardStepCollectioncs_aspx : System.Web.UI.Page
{ 

    void Page_Load(object sender, EventArgs e)
    {
        // Programmatically create a wizard control.
        Wizard Wizard1 = new Wizard();

        // Create steps for the wizard control and insert them
        // into the WizardStepCollection collection.
        for (int i = 0; i <= 5; i++)
        {
            WizardStepBase newStep = new WizardStep();
            newStep.ID = "Step" + (i + 1).ToString();
            newStep.Title = "Step " + (i + 1).ToString();
            Wizard1.WizardSteps.Add(newStep);
        }

        // Display the wizard control on the Web page.
        PlaceHolder1.Controls.Add(Wizard1);
    }
}
Partial Class WizardStepCollectionvb_aspx
    Inherits System.Web.UI.Page

    Public Sub Page_Load(ByVal sender As Object, ByVal e As EventArgs)

        ' Programmatically create a wizard control.
        Dim Wizard1 As Wizard = New Wizard()

        ' Create steps for the wizard control and insert them
        ' into the WizardStepCollection collection.
        For i As Integer = 0 To 5
            Dim newStep As WizardStepBase = New WizardStep()
            newStep.ID = "Step" + (i + 1).ToString()
            newStep.Title = "Step " + (i + 1).ToString()
            Wizard1.WizardSteps.Add(newStep)
        Next

        ' Display the wizard control on the Web page.
        PlaceHolder1.Controls.Add(Wizard1)

    End Sub

End Class

注釈

クラスは WizardStepCollection 、ウィザードとして機能するコントロール (コントロールやコントロールなど) に派生オブジェクトの WizardStepBaseコレクションを CreateUserWizard 格納および Wizard 管理するために使用されます。 たとえば、 コントロールはWizard、そのWizardStepsプロパティに WizardStepCollection クラスを使用します。

内の派生オブジェクトに WizardStepBaseアクセスするには、複数の WizardStepCollection方法があります。

  • プロパティを Item[] 使用して、特定の WizardStepBase0 から始まるインデックスにある派生オブジェクトに直接アクセスします。

  • メソッドを GetEnumerator 使用して、コレクションの反復処理に使用できる列挙子を作成します。

  • コレクションの CopyTo 内容を オブジェクトにコピーするには、 WizardStepCollection メソッドを Array 使用します。

プロパティ

Count

WizardStepBase コントロールの Wizard コレクション内の WizardStepCollection の派生オブジェクトの数を取得します。

IsReadOnly

コレクション内の WizardStepBase の派生オブジェクトを変更できるかどうかを示す値を取得します。

IsSynchronized

コレクションへのアクセスが同期されている (スレッド セーフである) かどうかを示す値を取得します。

Item[Int32]

コレクションの指定したインデックス位置にある WizardStepBase の派生オブジェクトを取得します。

SyncRoot

コレクションへのアクセスを同期するために使用できるオブジェクトを取得します。

メソッド

Add(WizardStepBase)

指定した WizardStepBase の派生オブジェクトをコレクションの末尾に追加します。

AddAt(Int32, WizardStepBase)

指定したインデックス位置に、指定した WizardStepBase の派生オブジェクトを追加します。

Clear()

コレクションからすべての WizardStepBase の派生オブジェクトを削除します。

Contains(WizardStepBase)

WizardStepCollection コレクションに特定の WizardStepBase の派生オブジェクトが格納されているかどうかを確認します。

CopyTo(WizardStepBase[], Int32)

WizardStepCollection コレクション内のすべての項目を互換性のある 1 次元の WizardStepBase オブジェクト配列にコピーします。コピー先の配列の指定したインデックス位置からコピーが開始されます。

Equals(Object)

指定されたオブジェクトが現在のオブジェクトと等しいかどうかを判断します。

(継承元 Object)
GetEnumerator()

コレクション内の IEnumerator の派生オブジェクトを反復処理するために使用できる WizardStepBase の実装オブジェクトを返します。

GetHashCode()

既定のハッシュ関数として機能します。

(継承元 Object)
GetType()

現在のインスタンスの Type を取得します。

(継承元 Object)
IndexOf(WizardStepBase)

コレクション内の指定した WizardStepBase の派生オブジェクトの位置を表すインデックス値を確認します。

Insert(Int32, WizardStepBase)

このコレクション内の指定したインデックス位置に、指定した WizardStepBase の派生オブジェクトを挿入します。

MemberwiseClone()

現在の Object の簡易コピーを作成します。

(継承元 Object)
Remove(WizardStepBase)

指定した WizardStepBase の派生オブジェクトをコレクションから削除します。

RemoveAt(Int32)

コレクションの指定した位置から WizardStepBase の派生オブジェクトを削除します。

ToString()

現在のオブジェクトを表す文字列を返します。

(継承元 Object)

明示的なインターフェイスの実装

ICollection.CopyTo(Array, Int32)

WizardStepCollection コレクション内のすべての項目を 1 次元の配列にコピーします。コピー先の配列の指定したインデックス位置からコピーが開始されます。

IList.Add(Object)

指定したオブジェクトをコレクションの末尾に追加します。

IList.Contains(Object)

指定したオブジェクトがコレクション内に存在するかどうかを示します。

IList.IndexOf(Object)

コレクション内の指定したオブジェクトの位置を表すインデックス値を確認します。

IList.Insert(Int32, Object)

指定したオブジェクトをコレクション内の指定した位置に挿入します。

IList.IsFixedSize

コレクションが固定サイズかどうかを示す値を取得します。

IList.Item[Int32]

コレクション内の指定したインデックス位置にあるオブジェクトを取得します。

IList.Remove(Object)

指定したオブジェクトをコレクションから削除します。

拡張メソッド

Cast<TResult>(IEnumerable)

IEnumerable の要素を、指定した型にキャストします。

OfType<TResult>(IEnumerable)

指定された型に基づいて IEnumerable の要素をフィルター処理します。

AsParallel(IEnumerable)

クエリの並列化を有効にします。

AsQueryable(IEnumerable)

IEnumerableIQueryable に変換します。

適用対象

こちらもご覧ください