Back to Devexpress

EditExtractOptionsContext Class

dashboard-devexpress-dot-dashboardwin-0928a5cc.md

latest5.6 KB
Original Source

EditExtractOptionsContext Class

Provides data for the Data Source Wizard pages related to the ExtractDataSource type.

Namespace : DevExpress.DashboardWin

Assembly : DevExpress.Dashboard.v25.2.Win.dll

NuGet Package : DevExpress.Win.Dashboard

Declaration

csharp
public sealed class EditExtractOptionsContext
vb
Public NotInheritable Class EditExtractOptionsContext

Example

This example demonstrates how to customize the Data Source Wizard pages and invoke a customized Wizard in the DashboardViewer.

The static EditExtractOptions(DashboardExtractDataSource, EditExtractOptionsContext) method invokes the Data Source Wizard.

To customize the Edit extract page, the application uses the approach described in the following document: How to Customize Views and Presenters Corresponding to Wizard Pages.

![](~/images/how-to-customize -extract-datasource-wizard.png)

View Example: How to Customize the Data Source Wizard and Invoke It in the DashboardViewer

csharp
private void btn_RunWizard_Click(object sender, EventArgs e) {
    EditExtractOptionsContext optionsContext = new EditExtractOptionsContext(this.GetActiveLookAndFeel(), this, dashboardViewer1.Dashboard.DataSources);
    optionsContext.WizardCustomization = new CustomExtractDataSourceWizardCustomizationService();
    ExtractDataSourceUIHelper.EditExtractOptions(new DashboardExtractDataSource() { FileName = "test.dat" }, optionsContext);
}
vb
Private Sub btn_RunWizard_Click(ByVal sender As Object, ByVal e As EventArgs) Handles btn_RunWizard.Click
    Dim optionsContext As New EditExtractOptionsContext(Me.GetActiveLookAndFeel(), Me, dashboardViewer1.Dashboard.DataSources)
    optionsContext.WizardCustomization = New CustomExtractDataSourceWizardCustomizationService()
    ExtractDataSourceUIHelper.EditExtractOptions(New DashboardExtractDataSource() With {.FileName = "test.dat"}, optionsContext)
End Sub

It implements the IExtractDataSourceWizardCustomization interface in a CustomExtractDataSourceWizardCustomizationService class to register a customized page view:

csharp
public class CustomExtractDataSourceWizardCustomizationService : IExtractDataSourceWizardCustomization {
    public void CustomizeDataSourceWizard(IWizardCustomization<ExtractDataSourceModel> customization) {
        customization.RegisterPageView<ICreateExtractDataSourcePageView, CustomConfigureExtractDataSourcePageView>();
    }
}
vb
Public Class CustomExtractDataSourceWizardCustomizationService
    Implements IExtractDataSourceWizardCustomization

    Public Sub CustomizeDataSourceWizard(ByVal customization As IWizardCustomization(Of ExtractDataSourceModel)) Implements IExtractDataSourceWizardCustomization.CustomizeDataSourceWizard
        customization.RegisterPageView(Of ICreateExtractDataSourcePageView, CustomConfigureExtractDataSourcePageView)()
    End Sub

End Class

A customized page view is the CustomConfigureExtractDataSourcePageView class that inherits the CreateExtractDataSourcePageView type:

csharp
public class CustomConfigureExtractDataSourcePageView : CreateExtractDataSourcePageView {
    public CustomConfigureExtractDataSourcePageView() : base() {                     
        this.checkEditExistingDataSource.Enabled = false;            
    }

    protected override void OnCheckEditExistingDataSourceCheckedChanged(object sender, EventArgs e) {
        base.OnCheckEditExistingDataSourceCheckedChanged(sender, e);
        TextEditFileName.Enabled = false;
    }
}
vb
Public Class CustomConfigureExtractDataSourcePageView
    Inherits CreateExtractDataSourcePageView

    Public Sub New()
        MyBase.New()
        Me.checkEditExistingDataSource.Enabled = False

    End Sub

    Protected Overrides Sub OnCheckEditExistingDataSourceCheckedChanged(ByVal sender As Object, ByVal e As EventArgs)
        MyBase.OnCheckEditExistingDataSourceCheckedChanged(sender, e)
        TextEditFileName.Enabled = False
    End Sub

End Class

Inheritance

Object EditExtractOptionsContext

See Also

EditExtractOptionsContext Members

DevExpress.DashboardWin Namespace