Back to Devexpress

EnvironmentPolicy.SuppressAll() Method

corelibraries-devexpress-dot-data-dot-utils-dot-environmentpolicy.md

latest2.1 KB
Original Source

EnvironmentPolicy.SuppressAll() Method

Suppresses all requests to System.Environment. No exception is thrown.

Namespace : DevExpress.Data.Utils

Assembly : DevExpress.Data.v25.2.dll

NuGet Package : DevExpress.Data

Declaration

csharp
public static void SuppressAll()
vb
Public Shared Sub SuppressAll

Remarks

The following example suppresses all requests to System.Environment initiated by DevExpress controls:

csharp
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.SuppressAll();
            Application.Run(new Form1());
        }
    }
}
vb
Imports System
Imports System.Windows.Forms

Namespace EnvironmentPolicyDemo
  Friend Module Program
    ''' <summary>
    ''' The main entry point for the application.
    ''' </summary>
    <STAThread>
    Sub Main()
      Application.EnableVisualStyles()
      Application.SetCompatibleTextRenderingDefault(False)
      DevExpress.Data.Utils.EnvironmentPolicy.SuppressAll()
      Application.Run(New Form1())
    End Sub
  End Module
End Namespace

Tip

Read the following topic for additional information: Environment Policy.

See Also

EnvironmentPolicy Class

EnvironmentPolicy Members

DevExpress.Data.Utils Namespace