ModulePropertiesPage.OnException(Exception) Method

Definition

Displays the exception message.

protected:
 virtual void OnException(Exception ^ ex);
protected virtual void OnException (Exception ex);
abstract member OnException : Exception -> unit
override this.OnException : Exception -> unit
Protected Overridable Sub OnException (ex As Exception)

Parameters

ex
Exception

The caught exception.

Examples

The following example calls the LoadPreferences method when an exception is caught.

protected override void LoadPreferences(
    PreferencesStore store) {

    try {
        base.LoadPreferences(store);

        _myCnfgBool = store.GetValue(CS.myCnfgBool, false);
        int i = store.GetValue(CS.zCnt, 1638);
        Trace.WriteLine("store.GetValue(zCnt, 1638); = "
            + i.ToString());

    } catch (Exception ex) {
        OnException(ex);
    }
}

Applies to