Skip to main content
All docs
V24.2

EnvironmentPolicy.SuppressGettingEnvironmentVariables() Method

Prevents DevExpress controls from reading environment variables.

Namespace: DevExpress.Data.Utils

Assembly: DevExpress.Data.v24.2.dll

Declaration

public static void SuppressGettingEnvironmentVariables()

Remarks

The following example activates the SuppressGettingEnvironmentVariables restrictive policy:

using System;
using System.Windows.Forms;

namespace EnvironmentPolicyDemo {
    internal static class Program {
        /// <summary>
        /// The main entry point for the application.
        /// </summary>
        [STAThread]
        static void Main() {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            DevExpress.Data.Utils.EnvironmentPolicy.SuppressGettingEnvironmentVariables();
            Application.Run(new Form1());
        }
    }
}

The EnvironmentPolicy fires the GettingVariable event when the DevExpress control attempts to retrieve the value of the environment variable from the current process. Handle the GettingVariable event to spot, analyze, and/or cancel the operation based on a specific condition.

Tip

Read the following topic for additional information: Environment Policy.

See Also