Compartilhar via


TaskLoggingHelperExtension.FormatResourceString(String, Object[]) Method

Definition

Loads the specified resource string and optionally formats it using the given arguments. The current thread's culture is used for formatting.

This API supports the product infrastructure and is not intended to be used directly from your code.

public:
 override System::String ^ FormatResourceString(System::String ^ resourceName, ... cli::array <System::Object ^> ^ args);
public override string FormatResourceString (string resourceName, params object[] args);
override this.FormatResourceString : string * obj[] -> string
Public Overrides Function FormatResourceString (resourceName As String, ParamArray args As Object()) As String

Parameters

resourceName
String

The name of the string resource to load.

args
Object[]

Optional arguments for formatting the loaded string.

Returns

The formatted string.

Exceptions

Thrown when resourceName is null.

Thrown when the string resource indicated by resourceName does not exist.

Thrown when the TaskResources property of the owner task is not set.

Remarks

1) This method requires the owner task to have registered its resources either via the Task (or TaskMarshalByRef) base class constructor, or the "Task.TaskResources" (or "AppDomainIsolatedTask.TaskResources") property. 2) This method is thread-safe.

Applies to