Back to Devexpress

XtraLocalizer.QueryLocalizedStringEventArgs.Value Property

corelibraries-devexpress-dot-utils-dot-localization-dot-xtralocalizer-dot-querylocalizedstringeventargs-01d75a44.md

latest4.5 KB
Original Source

XtraLocalizer.QueryLocalizedStringEventArgs.Value Property

Gets or sets the resource string.

Namespace : DevExpress.Utils.Localization

Assembly : DevExpress.Data.v25.2.dll

NuGet Package : DevExpress.Data

Declaration

csharp
public string Value { get; set; }
vb
Public Property Value As String

Property Value

TypeDescription
String

The resource string.

|

Remarks

Use the e.Value parameter to specify a translated (localized) version for the processed resource string.

csharp
using System;
using System.Windows.Forms;
using DevExpress.Utils.Localization;
using DevExpress.XtraEditors.Controls;
using DevExpress.XtraGrid.Localization;

namespace DXApplication {
    internal static class Program {
        /// <summary>
        /// The main entry point for the application.
        /// </summary>
        [STAThread]
        static void Main() {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            XtraLocalizer.QueryLocalizedString += XtraLocalizer_QueryLocalizedString;
            Application.Run(new Form1());
        }
        static private void XtraLocalizer_QueryLocalizedString(object sender, XtraLocalizer.QueryLocalizedStringEventArgs e) {
            if (e.StringIDType == typeof(GridStringId)) {
                if ((GridStringId)e.StringID == GridStringId.GridGroupPanelText)
                    e.Value = "Gruppenregion";
            }
            if (e.StringIDType == typeof(StringId)) {
                if ((StringId)e.StringID == StringId.PictureEditMenuCut)
                    e.Value = "Ausschneiden";
                if ((StringId)e.StringID == StringId.PictureEditMenuCopy)
                    e.Value = "Kopieren";
                if ((StringId)e.StringID == StringId.PictureEditMenuPaste)
                    e.Value = "Einfugen";
            }
        }
    }
}
vb
Imports System
Imports System.Windows.Forms
Imports DevExpress.Utils.Localization
Imports DevExpress.XtraEditors.Controls
Imports DevExpress.XtraGrid.Localization

Namespace DXApplication
    Friend Module Program
        ''' <summary>
        ''' The main entry point for the application.
        ''' </summary>
        <STAThread>
        Sub Main()
            Application.EnableVisualStyles()
            Application.SetCompatibleTextRenderingDefault(False)
            AddHandler XtraLocalizer.QueryLocalizedString, AddressOf XtraLocalizer_QueryLocalizedString
            Application.Run(New Form1())
        End Sub
        Private Sub XtraLocalizer_QueryLocalizedString(ByVal sender As Object, ByVal e As XtraLocalizer.QueryLocalizedStringEventArgs)
            If e.StringIDType Is GetType(GridStringId) Then
                If CType(e.StringID, GridStringId) Is GridStringId.GridGroupPanelText Then
                    e.Value = "Gruppenregion"
                End If
            End If
            If e.StringIDType Is GetType(StringId) Then
                If CType(e.StringID, StringId) Is StringId.PictureEditMenuCut Then
                    e.Value = "Ausschneiden"
                End If
                If CType(e.StringID, StringId) Is StringId.PictureEditMenuCopy Then
                    e.Value = "Kopieren"
                End If
                If CType(e.StringID, StringId) Is StringId.PictureEditMenuPaste Then
                    e.Value = "Einfugen"
                End If
            End If
        End Sub
    End Module
End Namespace

Note

Setting the e.Value property within the QueryLocalizedStringNonTranslated event handler has no effect.

See Also

XtraLocalizer.QueryLocalizedStringEventArgs Class

XtraLocalizer.QueryLocalizedStringEventArgs Members

DevExpress.Utils.Localization Namespace