Bewerken

Share via


ComponentResourceManager.ApplyResources Method

Definition

Apply a resource's value to the corresponding property of the object.

Overloads

ApplyResources(Object, String)

Applies a resource's value to the corresponding property of the object.

ApplyResources(Object, String, CultureInfo)

Applies a resource's value to the corresponding property of the object.

ApplyResources(Object, String)

Source:
ComponentResourceManager.cs
Source:
ComponentResourceManager.cs
Source:
ComponentResourceManager.cs

Applies a resource's value to the corresponding property of the object.

public:
 void ApplyResources(System::Object ^ value, System::String ^ objectName);
public void ApplyResources (object value, string objectName);
member this.ApplyResources : obj * string -> unit
Public Sub ApplyResources (value As Object, objectName As String)

Parameters

value
Object

An Object that contains the property value to be applied.

objectName
String

A String that contains the name of the object to look up in the resources.

Exceptions

value or objectName is null.

Remarks

This method examines all the resources for the current culture used in the development environment. It attempts to find a resource with a key in the format of objectName.propertyName, where objectName is passed in as a parameter and propertyName is the name of a property. It will then apply that resource's value to the corresponding property of the object. If there is no matching property, the resource will be ignored.

Applies to

ApplyResources(Object, String, CultureInfo)

Source:
ComponentResourceManager.cs
Source:
ComponentResourceManager.cs
Source:
ComponentResourceManager.cs

Applies a resource's value to the corresponding property of the object.

public:
 virtual void ApplyResources(System::Object ^ value, System::String ^ objectName, System::Globalization::CultureInfo ^ culture);
public virtual void ApplyResources (object value, string objectName, System.Globalization.CultureInfo culture);
public virtual void ApplyResources (object value, string objectName, System.Globalization.CultureInfo? culture);
abstract member ApplyResources : obj * string * System.Globalization.CultureInfo -> unit
override this.ApplyResources : obj * string * System.Globalization.CultureInfo -> unit
Public Overridable Sub ApplyResources (value As Object, objectName As String, culture As CultureInfo)

Parameters

value
Object

An Object that contains the property value to be applied.

objectName
String

A String that contains the name of the object to look up in the resources.

culture
CultureInfo

The culture for which to apply resources.

Exceptions

value or objectName is null.

Remarks

This method examines all the resources for the provided culture. If culture is null, the current culture is assumed.

The ApplyResources method attempts to find a resource with a key in the format of objectName.propertyName, where objectName is passed in as a parameter and propertyName is the name of a property. It will then apply that resource's value to the corresponding property of the object. If there is no matching property, the resource will be ignored.

Applies to