Back to Devexpress

XtraLocalizer.EnterTraceMode(String) Method

corelibraries-devexpress-dot-utils-dot-localization-dot-xtralocalizer-dot-entertracemode-x28-system-dot-string-x29.md

latest4.2 KB
Original Source

XtraLocalizer.EnterTraceMode(String) Method

Create the trace source and allows the UI Localization Client to attach to the application.

Namespace : DevExpress.Utils.Localization

Assembly : DevExpress.Data.v25.2.dll

NuGet Package : DevExpress.Data

Declaration

csharp
public static IDisposable EnterTraceMode(
    string applicationName = null
)
vb
Public Shared Function EnterTraceMode(
    applicationName As String = Nothing
) As IDisposable

Optional Parameters

NameTypeDefaultDescription
applicationNameStringnull

The application name. Specify this parameter if the UI Localization Client cannot automatically obtain the application name.

|

Returns

TypeDescription
IDisposable

An object that implements System.IDisposable.

|

Remarks

The UI Localization Client is a cross-platform utility sipped as part of DevExpress Subscriptions that allows you to quickly identify non-translated strings of DevExpress UI controls and translate them during a debug session. The utility automatically generates a RESX file(s) with translated resources and adds it to the project.

Read the following topic for additional information: DevExpress UI Localization Client (Maintenance Mode).

Example (WinForms)

csharp
using System;
using System.Globalization;
using System.Windows.Forms;
using DevExpress.Utils.Localization;

namespace DXApplication10 {
    internal static class Program {
        /// <summary>
        /// The main entry point for the application.
        /// </summary>
        [STAThread]
        static void Main() {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            CultureInfo culture = CultureInfo.CreateSpecificCulture("de-DE");
            CultureInfo.DefaultThreadCurrentCulture = culture;
            CultureInfo.DefaultThreadCurrentUICulture = culture;
#if DEBUG
            using (XtraLocalizer.EnterTraceMode(applicationName: "MyApp"))
                Application.Run(new Form1());
#else
            Application.Run(new Form1());
#endif
        }
    }
}
vb
Imports System
Imports System.Globalization
Imports System.Windows.Forms
Imports DevExpress.Utils.Localization

Namespace DXApplication10
    Friend Module Program
        ''' <summary>
        ''' The main entry point for the application.
        ''' </summary>
        <STAThread>
        Sub Main()
            Application.EnableVisualStyles()
            Application.SetCompatibleTextRenderingDefault(False)
            Dim culture As CultureInfo = CultureInfo.CreateSpecificCulture("de-DE")
            CultureInfo.DefaultThreadCurrentCulture = culture
            CultureInfo.DefaultThreadCurrentUICulture = culture
#If DEBUG Then
            Using XtraLocalizer.EnterTraceMode(applicationName:= "MyApp")
                Application.Run(New Form1())
            End Using
#Else
            Application.Run(New Form1())
#End If
        End Sub
    End Module
End Namespace

See Also

DevExpress UI Localization Client (Maintenance Mode)

EnableTraceSource

XtraLocalizer Class

XtraLocalizer Members

DevExpress.Utils.Localization Namespace