Determining the preview-status of a component via C#

Dear all,
I would like to check in a component’s SolveInstance-method whether its preview is enabled or disabled.
Does anyone know how this can be done?
– Clemens

var someDocObject = ....;
var previewEnabled = (someDocObject is IGH_PreviewObject previewObj)
    && !previewObj.Hidden;

or for the current component

!this.Hidden

Be advised this doesn’t check whether there IS something available to be previewed.