Edit

Share via


EventSourceAttribute.LocalizationResources Property

Definition

Gets or sets the name of the localization resource file.

public:
 property System::String ^ LocalizationResources { System::String ^ get(); void set(System::String ^ value); };
public string LocalizationResources { get; set; }
public string? LocalizationResources { get; set; }
member this.LocalizationResources : string with get, set
Public Property LocalizationResources As String

Property Value

The name of the localization resource file, or null if the localization resource file does not exist.

Remarks

Event sources support the localization of events. You can localize the names used for events, operation codes, tasks, keywords, and maps to multiple languages. To localize events, create a .ResX style string table by adding a resource file to your project. The resource file is given a name (for example, DefaultNameSpace.ResourceFileName) that can be passed to the ResourceManager constructor that will read the resources. This name is the value of the LocalizationResources property. If the LocalizationResources property is not null, the EventSource object looks up the localized strings for events by using the following resource naming scheme, where the terms in uppercase represent the name of the event, task, keyword, or map value that should be localized:

  • event_EVENTNAME

  • task_TASKNAME

  • keyword_KEYWORDNAME

  • map_MAPNAME

Note that the localized string for an event corresponds to the message string and can have {0} values, which represent the payload values.

Applies to