Share via


ModuleDialogPage.ApplyChanges Method

Definition

When overridden in a derived class, returns a value indicating the success of applied changes.

protected:
 abstract bool ApplyChanges();
protected abstract bool ApplyChanges ();
abstract member ApplyChanges : unit -> bool
Protected MustOverride Function ApplyChanges () As Boolean

Returns

true if changes have been applied successfully; otherwise, false.

Examples

The following example implements the ApplyChanges method.

protected override bool ApplyChanges() {

    bool appliedChanges = false;
    if (!ReadOnly || !UIInfoValid())
        return false;

    try {
        Cursor.Current = Cursors.WaitCursor;

        bool directoryExists = _serviceProxy.UpdateSettings(_updatedBag);
        if (!directoryExists) {
            ShowError(null, "Cannot access directory", true);
        }

        _bag = _updatedBag.Clone();
        appliedChanges = true;
        _hasChanges = false;

    } catch (Exception ex) {
        DisplayErrorMessage(ex, _resourceMgr);
    } finally {
        Cursor.Current = Cursors.Default;
        Update();
    }

    return appliedChanges;
} 

Applies to