Skip to main content
All docs
V25.1
  • ProcessStartPolicy.InvokeConfirmedIfNotAlreadyInTrustedContext(Action, Predicate<ProcessStartPolicy.RestrictedProcessStartConfirmationEventArgs>) Method

    This member is for advanced configuration. It supports the internal infrastructure, and is not intended to be used directly from your code.

    Namespace: DevExpress.Data.Utils

    Assembly: DevExpress.Data.Desktop.v25.1.dll

    NuGet Packages: DevExpress.Data.Desktop, DevExpress.ExpressApp.Win.Design

    Declaration

    public static void InvokeConfirmedIfNotAlreadyInTrustedContext(
        Action restrictedAction,
        Predicate<ProcessStartPolicy.RestrictedProcessStartConfirmationEventArgs> confirmOnce
    )

    Parameters

    Name Type
    restrictedAction Action
    confirmOnce Predicate<ProcessStartPolicy.RestrictedProcessStartConfirmationEventArgs>

    Remarks

    HashSet<string> validSchemes = new HashSet<string>(StringComparer.Ordinal) {
        Uri.UriSchemeHttps, Uri.UriSchemeHttp, Uri.UriSchemeMailto
    };
    ProcessStartPolicy.InvokeConfirmedIfNotAlreadyInTrustedContext(() => {
        SafeProcess.TryStart(@"notepad.exe");
    }, uri => validSchemes.Contains(uri.Scheme));
    

    See the following topic for more information: Suppress New Processes Initiated by .NET Controls.

    See Also