Back to Devexpress

EnvironmentPolicy.SuppressReadingCurrentProcessData() Method

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

latest2.7 KB
Original Source

EnvironmentPolicy.SuppressReadingCurrentProcessData() Method

Prevents DevExpress controls from reading current process data (for example, CurrentDirectory, ProcessId, ProcessPath).

Namespace : DevExpress.Data.Utils

Assembly : DevExpress.Data.v25.2.dll

NuGet Package : DevExpress.Data

Declaration

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

Remarks

The following example activates the SuppressReadingCurrentProcessData restrictive policy:

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.SuppressReadingCurrentProcessData();
            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.SuppressReadingCurrentProcessData()
      Application.Run(New Form1())
    End Sub
  End Module
End Namespace

The EnvironmentPolicy fires the ReadingCurrentProcessData event when the DevExpress control attempts to read current process data. Handle the ReadingCurrentProcessData 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

EnvironmentPolicy Class

EnvironmentPolicy Members

DevExpress.Data.Utils Namespace