Back to Devexpress

EnvironmentPolicy.FailedEventArgs.ToString() Method

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

latest2.9 KB
Original Source

EnvironmentPolicy.FailedEventArgs.ToString() Method

Returns a human-readable representation of the FailedEventArgs object, which can be useful for debugging, logging, or understanding the failure.

Namespace : DevExpress.Data.Utils

Assembly : DevExpress.Data.v25.2.dll

NuGet Package : DevExpress.Data

Declaration

csharp
public override string ToString()
vb
Public Overrides Function ToString As String

Returns

TypeDescription
String

The string representation of the FailedEventArgs object.

|

Remarks

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.ThrowOnErrors();
            DevExpress.Data.Utils.EnvironmentPolicy.Failed += EnvironmentPolicy_Failed;
            Application.Run(new Form1());
        }

        static void EnvironmentPolicy_Failed(object sender, DevExpress.Data.Utils.EnvironmentPolicy.FailedEventArgs e) {
            Console.WriteLine(e.ToString());
            e.Throw = false;
        }
    }
}
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.ThrowOnErrors()
            AddHandler DevExpress.Data.Utils.EnvironmentPolicy.Failed, AddressOf EnvironmentPolicy_Failed
            Application.Run(New Form1())
        End Sub

        Private Sub EnvironmentPolicy_Failed(ByVal sender As Object, ByVal e As DevExpress.Data.Utils.EnvironmentPolicy.FailedEventArgs)
            Console.WriteLine(e.ToString())
            e.Throw = False
        End Sub
    End Module
End Namespace

See Also

EnvironmentPolicy.FailedEventArgs Class

EnvironmentPolicy.FailedEventArgs Members

DevExpress.Data.Utils Namespace