IProgressIndicationService Interface

Exposes functionality that enables you to display a progress indicator for time-consuming operations.

Namespace: DevExpress.Services

Assembly: DevExpress.Data.v19.2.dll

Declaration

public interface IProgressIndicationService
Public Interface IProgressIndicationService

Remarks

The IProgressIndicationService interface can be used in RichEditControl to track the progress of export, import and mail merge operations. In this case, it is called internally by the RichEditControl only if the projected duration of an operation exceeds a certain threshold (ca. 500 ms)

class MyProgressIndicatorService : IProgressIndicationService
{
    private ProgressBarControl _Indicator;
    public ProgressBarControl Indicator
    {
        get { return _Indicator; }
        set { _Indicator = value; }
    }

    public MyProgressIndicatorService(IServiceProvider provider, ProgressBarControl indicator)
    {
        _Indicator = indicator;
    }

    #region IProgressIndicationService Members

    void IProgressIndicationService.Begin(string displayName, int minProgress, int maxProgress, int currentProgress)
    {
        _Indicator.Properties.Minimum = minProgress;
        _Indicator.Properties.Maximum = maxProgress;
        _Indicator.Properties.ShowTitle = true;
        _Indicator.EditValue = currentProgress;
        _Indicator.Refresh();
        _Indicator.Show();            
    }

    void IProgressIndicationService.End()
    {
        _Indicator.Refresh();
        _Indicator.Hide();
    }

    void IProgressIndicationService.SetProgress(int currentProgress)
    {
        _Indicator.EditValue = currentProgress;
        _Indicator.Refresh();
    }
    #endregion
}
using DevExpress.Services;
            richEditControl1.ReplaceService<IProgressIndicationService>
                (new MyProgressIndicatorService(richEditControl1, this.progressBarControl1));
See Also