次の方法で共有


WizardForm クラス

定義

オブジェクトを含む WizardPage ウィザード フォームの基本クラスを提供します。

public ref class WizardForm abstract : Microsoft::Web::Management::Client::Win32::BaseTaskForm
public abstract class WizardForm : Microsoft.Web.Management.Client.Win32.BaseTaskForm
type WizardForm = class
    inherit BaseTaskForm
Public MustInherit Class WizardForm
Inherits BaseTaskForm
継承

次の例では、 クラスのいくつかのメソッドとプロパティを WizardForm 実装しています。 この例のウィザード フォームには、3 つの WizardPage オブジェクトが含まれています。 最初のウィザード ページには、[ 送信] ボタンがあるユーザー名とパスワードのテキスト ボックスが表示され、ユーザーは次のウィザード ページに移動する前に検証のために資格情報を送信できます。

using System;
using System.Collections;
using System.Collections.Generic;
//using System.ComponentModel;
using System.Data;
using System.Drawing;
//using System.Text;
using System.Windows.Forms;
using Microsoft.Web.Management.Client;
using Microsoft.Web.Management.Client.Win32;

namespace ExtensibilityDemo
{
    public partial class DemoModuleWizardForm : WizardForm
    {
        public DemoModuleWizardForm(IServiceProvider serviceProvider)
            : base(serviceProvider)
        {
            InitializeComponent();
            // Upon initial load, the StartPageIndex page is loaded.
            // Get the Pages for this Form;
            int pageCount = Pages.Count;
            TaskCaptionBorderStyle = BorderStyle.None;
            StartTaskProgress();
        }
        private void InitializeComponent()
        {
            this.LoginPage = new ExtensibilityDemo.
                DemoModuleWizardLoginPage();
            this.ModificationPage = new ExtensibilityDemo.
                DemoModuleWizardModificationPage();
            this.LabelPage = new ExtensibilityDemo.
                DemoModuleWizardLabelPage();
            this.SuspendLayout();
            //
            // demomModuleWizardLoginPage
            // 
            this.LoginPage.AutoSize = true;
            this.LoginPage.BackColor = System.Drawing.Color.Silver;
            this.LoginPage.Location = new System.Drawing.Point(25, 25);
            this.LoginPage.Name = "LoginPage";
            this.LoginPage.RightToLeftLayout = false;
            this.LoginPage.Size = new System.Drawing.Size(250, 200);
            this.LoginPage.TabIndex = 1;
            // 
            // demomModuleWizardModificationPage
            // 
            this.ModificationPage.AutoSize = true;
            this.ModificationPage.BackColor = System.Drawing.Color.Silver;
            this.ModificationPage.Location = new System.Drawing.Point(25, 25);
            this.ModificationPage.Name = "ModificationPage";
            //this.ModificationPage.RightToLeftLayout = false;
            this.ModificationPage.Size = new System.Drawing.Size(250, 200);
            this.ModificationPage.TabIndex = 2;
            // 
            // 
            // demomModuleWizardLabelPage
            // 
            this.LabelPage.AutoSize = true;
            this.LabelPage.BackColor = System.Drawing.Color.Silver;
            this.LabelPage.Location = new System.Drawing.Point(25, 25);
            this.LabelPage.Name = "LabelPage";
            this.LabelPage.RightToLeftLayout = false;
            this.LabelPage.Size = new System.Drawing.Size(250, 200);
            this.LabelPage.TabIndex = 3;
            // 
            // demoModuleWizardForm
            // 
            this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
            this.ClientSize = new System.Drawing.Size(400, 400);
            this.Name = "demoModuleWizardForm";
            this.Padding = new System.Windows.Forms.Padding(0, 64, 0, 0);
            //           
            // Establish Task Information
            //
            this.Text = "Wizard";
            this.Name = "Wizard";
            this.TaskCaption = "Wizard Form";
            this.TaskDescription = "Build Wizard Form and Wizard Pages.";
            this.ResumeLayout(false); 
        }

        private ExtensibilityDemo.DemoModuleWizardLoginPage LoginPage;
        private ExtensibilityDemo.DemoModuleWizardLabelPage LabelPage;
        private ExtensibilityDemo.DemoModuleWizardModificationPage ModificationPage;
        // Customize the abstract CompleteWizard();
        protected override void CompleteWizard()
        {
            Close();
        }
        // Customize the abstract GetWizardPages.
        protected override WizardPage[] GetWizardPages()
        {
            return new WizardPage[]
            {
                // Create each wizard page.
                new DemoModuleWizardLoginPage(),
                new DemoModuleWizardLabelPage(),
                new DemoModuleWizardModificationPage()
            };
        }
        protected new IList Pages
        {
            get
            {
                // Get a wizard page collection.
                WizardPage[] wizardPages = GetWizardPages();
                ShowMessage("There are " + wizardPages.Length + " wizard pages.");
                return wizardPages;
            }
        }
        // Customize the StartTaskProgressMethod.
        protected override void StartTaskProgress()
        {
            TaskProgressStartColor = Color.Red;
            TaskProgressEndColor = Color.Yellow;
            // Default TaskProgressScrollSpeed is a value of 6.
            TaskProgressScrollSpeed = 2;
            // Default TaskProgressGradientSpeed is a value of 1;
            TaskProgressGradientSpeed = 3;
            //Set the task Glyph.
            TaskGlyph = Icon.FromHandle(Cursors.Arrow.Handle).ToBitmap();
            TaskGlyph.RotateFlip(RotateFlipType.Rotate90FlipNone);
            // Implement the StartTaskProgress from the base class.
            base.StartTaskProgress();
        }
        // Customize the IsCancellable property. Default is true;
        protected override bool IsCancellable
        {
            get
            {
                return true;
            }
        }
        // Customize the CancelWizard method.
        protected override void CancelWizard()
        {
            //Check the IsCancellable property before performing a cancel.
            if (IsCancellable)
            {
                // Verify that the user wants to cancel the wizard.
                DialogResult result = ShowMessage("Are you sure you want to exit?",
                    MessageBoxButtons.YesNo,
                    MessageBoxIcon.Question,
                    MessageBoxDefaultButton.Button2);
                if (result == DialogResult.Yes)
                {
                    base.StopTaskProgress();
                    base.CancelWizard();
                }
            }
        }
        // Customize the OnPageChanged method
        protected override void  OnPageChanged(EventArgs e)
        {
            // To get to the LabelPage the user has been validated.
            if (this.CurrentPage.Name == "demoModuleWizardLabelPage")
            {
                this.TaskCaption = "User is signed in";
            }
            base.OnPageChanged(e);
        }
        // Customize the Border Margin. The default is 14 pixels;
        protected override int BorderMargin
        {
            get
            {
                return 25;
            }
        }
        // Customize the OnLoad method, with the user's name.
        protected override void OnLoad(EventArgs e)
        {
            base.OnLoad(e);
            Controls[0].Controls["_pageContainer"].
                Controls["demoModuleWizardLoginPage"].
                Controls["textBox1"].Text =
                System.Environment.UserName;
        }
    }
}
using System;
using System.Collections;
using System.Collections.Generic;
//using System.ComponentModel;
using System.Data;
using System.Drawing;
//using System.Text;
using System.Windows.Forms;
using Microsoft.Web.Management.Client;
using Microsoft.Web.Management.Client.Win32;

namespace ExtensibilityDemo
{
    public partial class DemoModuleWizardForm : WizardForm
    {
        public DemoModuleWizardForm(IServiceProvider serviceProvider)
            : base(serviceProvider)
        {
            InitializeComponent();
            // Upon initial load, the StartPageIndex page is loaded.
            // Get the Pages for this Form;
            int pageCount = Pages.Count;
            TaskCaptionBorderStyle = BorderStyle.None;
            StartTaskProgress();
        }
        private void InitializeComponent()
        {
            this.LoginPage = new ExtensibilityDemo.
                DemoModuleWizardLoginPage();
            this.ModificationPage = new ExtensibilityDemo.
                DemoModuleWizardModificationPage();
            this.LabelPage = new ExtensibilityDemo.
                DemoModuleWizardLabelPage();
            this.SuspendLayout();
            //
            // demomModuleWizardLoginPage
            // 
            this.LoginPage.AutoSize = true;
            this.LoginPage.BackColor = System.Drawing.Color.Silver;
            this.LoginPage.Location = new System.Drawing.Point(25, 25);
            this.LoginPage.Name = "LoginPage";
            this.LoginPage.RightToLeftLayout = false;
            this.LoginPage.Size = new System.Drawing.Size(250, 200);
            this.LoginPage.TabIndex = 1;
            // 
            // demomModuleWizardModificationPage
            // 
            this.ModificationPage.AutoSize = true;
            this.ModificationPage.BackColor = System.Drawing.Color.Silver;
            this.ModificationPage.Location = new System.Drawing.Point(25, 25);
            this.ModificationPage.Name = "ModificationPage";
            //this.ModificationPage.RightToLeftLayout = false;
            this.ModificationPage.Size = new System.Drawing.Size(250, 200);
            this.ModificationPage.TabIndex = 2;
            // 
            // 
            // demomModuleWizardLabelPage
            // 
            this.LabelPage.AutoSize = true;
            this.LabelPage.BackColor = System.Drawing.Color.Silver;
            this.LabelPage.Location = new System.Drawing.Point(25, 25);
            this.LabelPage.Name = "LabelPage";
            this.LabelPage.RightToLeftLayout = false;
            this.LabelPage.Size = new System.Drawing.Size(250, 200);
            this.LabelPage.TabIndex = 3;
            // 
            // demoModuleWizardForm
            // 
            this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
            this.ClientSize = new System.Drawing.Size(400, 400);
            this.Name = "demoModuleWizardForm";
            this.Padding = new System.Windows.Forms.Padding(0, 64, 0, 0);
            //           
            // Establish Task Information
            //
            this.Text = "Wizard";
            this.Name = "Wizard";
            this.TaskCaption = "Wizard Form";
            this.TaskDescription = "Build Wizard Form and Wizard Pages.";
            this.ResumeLayout(false); 
        }

        private ExtensibilityDemo.DemoModuleWizardLoginPage LoginPage;
        private ExtensibilityDemo.DemoModuleWizardLabelPage LabelPage;
        private ExtensibilityDemo.DemoModuleWizardModificationPage ModificationPage;
        // Customize the abstract CompleteWizard();
        protected override void CompleteWizard()
        {
            Close();
        }
        // Customize the abstract GetWizardPages.
        protected override WizardPage[] GetWizardPages()
        {
            return new WizardPage[]
            {
                // Create each wizard page.
                new DemoModuleWizardLoginPage(),
                new DemoModuleWizardLabelPage(),
                new DemoModuleWizardModificationPage()
            };
        }
        protected new IList Pages
        {
            get
            {
                // Get a wizard page collection.
                WizardPage[] wizardPages = GetWizardPages();
                ShowMessage("There are " + wizardPages.Length + " wizard pages.");
                return wizardPages;
            }
        }
        // Customize the StartTaskProgressMethod.
        protected override void StartTaskProgress()
        {
            TaskProgressStartColor = Color.Red;
            TaskProgressEndColor = Color.Yellow;
            // Default TaskProgressScrollSpeed is a value of 6.
            TaskProgressScrollSpeed = 2;
            // Default TaskProgressGradientSpeed is a value of 1;
            TaskProgressGradientSpeed = 3;
            //Set the task Glyph.
            TaskGlyph = Icon.FromHandle(Cursors.Arrow.Handle).ToBitmap();
            TaskGlyph.RotateFlip(RotateFlipType.Rotate90FlipNone);
            // Implement the StartTaskProgress from the base class.
            base.StartTaskProgress();
        }
        // Customize the IsCancellable property. Default is true;
        protected override bool IsCancellable
        {
            get
            {
                return true;
            }
        }
        // Customize the CancelWizard method.
        protected override void CancelWizard()
        {
            //Check the IsCancellable property before performing a cancel.
            if (IsCancellable)
            {
                // Verify that the user wants to cancel the wizard.
                DialogResult result = ShowMessage("Are you sure you want to exit?",
                    MessageBoxButtons.YesNo,
                    MessageBoxIcon.Question,
                    MessageBoxDefaultButton.Button2);
                if (result == DialogResult.Yes)
                {
                    base.StopTaskProgress();
                    base.CancelWizard();
                }
            }
        }
        // Customize the OnPageChanged method
        protected override void  OnPageChanged(EventArgs e)
        {
            // To get to the LabelPage the user has been validated.
            if (this.CurrentPage.Name == "demoModuleWizardLabelPage")
            {
                this.TaskCaption = "User is signed in";
            }
            base.OnPageChanged(e);
        }
        // Customize the Border Margin. The default is 14 pixels;
        protected override int BorderMargin
        {
            get
            {
                return 25;
            }
        }
        // Customize the OnLoad method, with the user's name.
        protected override void OnLoad(EventArgs e)
        {
            base.OnLoad(e);
            Controls[0].Controls["_pageContainer"].
                Controls["demoModuleWizardLoginPage"].
                Controls["textBox1"].Text =
                System.Environment.UserName;
        }
    }
}

注釈

このクラスは抽象であるため、そのインスタンスを直接作成することはできません。

WizardFormオブジェクトには 1 つ以上のウィザード ページが含まれており、複数の手順で関連データを収集するためのユーザー インターフェイス (UI) が作成されます。

注意 (実装者)

WizardForm から継承する場合は、CompleteWizard() メンバーと GetWizardPages() メンバーをオーバーライドする必要があります。

コンストラクター

WizardForm(IServiceProvider)

WizardForm クラスの新しいインスタンスを初期化します。

プロパティ

BackgroundJobRunning

バックグラウンド ワーカー スレッドがビジー状態かどうかを示す値を取得します。

(継承元 BaseTaskForm)
BorderMargin

ウィザード フォームのウィザード ページの周囲の余白の幅を取得します。

CanCancel

派生クラスでオーバーライドされると、ウィザードを取り消すことができるかどうかを示す値を取得します。

CanComplete

派生クラスでオーバーライドされると、ウィザードを完了できるかどうかを示す値を取得します。

CanShowHelp

ユーザーがヘルプ ファイルを表示できるかどうかを示す値を取得します。

CurrentPage

ウィザード フォームに表示されている現在のページを取得します。

IsCancellable

派生クラスでオーバーライドされると、ウィザードを取り消すことができるかどうかを示す値を取得します。

Pages

ウィザード内の IList ページのコレクションを含むインターフェイスを取得します。

ServiceProvider

クラスのサービス オブジェクトを取得します。

(継承元 BaseForm)
StartPageIndex

派生クラスでオーバーライドされると、ウィザードが最初に読み込まれるときに表示される最初のページのページ インデックスを取得します。

TaskCaption

タスク、ウィザード フォーム、またはその他のオブジェクトのキャプションを取得または設定します。

TaskCaptionBorderStyle

タスク キャプションの罫線のスタイルを取得または設定します。

TaskDescription

タスク、ウィザード フォーム、またはその他のオブジェクトの説明を取得または設定します。

TaskGlyph

フォームのイメージを取得または設定します。

TaskProgressEndColor

進行状況バーのグラデーションの終了色を取得または設定します。

TaskProgressGradientSpeed

進行状況バーが一度に表示する色グラデーション のサイクル数を取得または設定します。

TaskProgressScrollSpeed

進行状況バーのスクロール速度を取得または設定します。

TaskProgressStartColor

進行状況バーのグラデーションの開始色を取得または設定します。

WizardData

派生クラスでオーバーライドされると、ウィザードの情報を取得します。

メソッド

CancelAsyncTask()

ユーザーが現在のタスクを取り消すメソッドを提供します。

(継承元 BaseTaskForm)
CancelWizard()

派生クラスでオーバーライドされると、ユーザーがウィザード フォームを取り消したことを示します。

CompleteWizard()

派生クラスでオーバーライドされると、ユーザーは [ 完了 ] ボタンをクリックしてウィザードを閉じます。

DisplayErrorMessage(Exception, ResourceManager)

指定した例外とリソース マネージャーに基づいて、エラー メッセージが表示されたモーダル ダイアログ ボックスを表示します。

(継承元 BaseTaskForm)
Dispose(Boolean)

BaseForm によって使用されているアンマネージド リソースを解放し、オプションでマネージド リソースも解放します。

(継承元 BaseForm)
GetService(Type)

要求したサービスを取得します。

(継承元 BaseForm)
GetWizardPages()

派生クラスでオーバーライドされると、ウィザード フォームに含まれるウィザード ページのコレクションが返されます。

InvalidateTask(Boolean)

進行状況バーを無効にし、コントロールを再描画します。

(継承元 BaseTaskForm)
NavigateToNextPage()

ウィザード フォームの次のウィザード ページに移動するメカニズムを提供します。

NavigateToPreviousPage()

ウィザード フォームの前のウィザード ページに移動するメカニズムを提供します。

OnActivated(EventArgs)

基本フォームがアクティブになると発生します。

(継承元 BaseForm)
OnClosing(CancelEventArgs)

フォームが閉じられ、イベントが Closing 発生することを示します。

OnHelpRequested(HelpEventArgs)

ヘルプ コントロールがアクティブになったときに発生します。

(継承元 BaseForm)
OnInitialActivated(EventArgs)

フォームが初めて読み込まれたことを示し、イベントを Activated 発生させます。

OnLoad(EventArgs)

ウィザード フォームが読み込まれ、イベントが Load 発生することを示します。

OnPageChanged(EventArgs)

ユーザーが現在のページからウィザード フォームの前または次のページに移動したことを示します。

OnPageChanging(EventArgs)

派生クラスでオーバーライドされた場合、ユーザーが現在のページからウィザード フォームの前または次のページに移動していることを示します。

OnPaint(PaintEventArgs)

ウィザード フォームが再描画されていることを示し、イベントを Paint 発生させます。

SetButtonsPanel(Control)

ボタン パネルにボタンを追加します。

(継承元 BaseTaskForm)
SetContent(Control)

IIS マネージャーの [コンテンツ ビュー ] ページのコントロールを設定します。

(継承元 BaseTaskForm)
ShouldShowPage(WizardPage)

派生クラスでオーバーライドされた場合、ウィザードフォームに表示できるウィザードのページを決定します。

ShowError(Exception, String, Boolean)

指定した例外および例外に関する情報をメッセージ ボックスに表示します。

(継承元 BaseForm)
ShowHelp()

ウィザードのヘルプ ファイルを表示するメカニズムを提供します。

ShowMessage(String)

指定したテキストを使用するメッセージ ボックスを表示します。

(継承元 BaseForm)
ShowMessage(String, MessageBoxButtons, MessageBoxIcon, MessageBoxDefaultButton)

指定したテキスト、ボタン セット、シンボル、および既定のボタンを使用するメッセージ ボックスを表示します。

(継承元 BaseForm)
StartAsyncTask(DoWorkEventHandler, RunWorkerCompletedEventHandler)

ワーカー スレッドを使用してタスクを開始し、作業完了イベント ハンドラーを構成します。

(継承元 BaseTaskForm)
StartAsyncTask(DoWorkEventHandler, RunWorkerCompletedEventHandler, MethodInvoker)

ワーカー スレッドを使用してタスクを開始し、作業完了イベント ハンドラーと cancel-task イベント ハンドラーを構成します。

(継承元 BaseTaskForm)
StartAsyncTask(DoWorkEventHandler, RunWorkerCompletedEventHandler, MethodInvoker, Object)

ワーカー スレッドを使用してタスクを開始し、作業完了イベント ハンドラーと cancel-task イベント ハンドラーを構成し、オブジェクトをタスク イベント ハンドラーに渡します。

(継承元 BaseTaskForm)
StartTaskProgress()

進行状況バーを開始します。

StopTaskProgress()

進行状況バーを停止します。

Update()

ウィザード フォームのビューを更新します。

UpdateWizard()

ウィザード フォームのビューを更新します。

WndProc(Message)

状況依存の ヘルプ ボタン イベントを メソッドに ShowHelp() 再ルーティングします。

(継承元 BaseForm)

適用対象